Merge "Save and re-bind previously bounded texture when using cairo_gl_surface_set_bi...
[framework/web/webkit-efl.git] / Source / JavaScriptCore / CMakeLists.txt
1 SET(JavaScriptCore_INCLUDE_DIRECTORIES
2     "${CMAKE_BINARY_DIR}"
3     "${JAVASCRIPTCORE_DIR}"
4     "${JAVASCRIPTCORE_DIR}/API"
5     "${JAVASCRIPTCORE_DIR}/ForwardingHeaders"
6     "${JAVASCRIPTCORE_DIR}/assembler"
7     "${JAVASCRIPTCORE_DIR}/bytecode"
8     "${JAVASCRIPTCORE_DIR}/bytecompiler"
9     "${JAVASCRIPTCORE_DIR}/dfg"
10     "${JAVASCRIPTCORE_DIR}/disassembler"
11     "${JAVASCRIPTCORE_DIR}/heap"
12     "${JAVASCRIPTCORE_DIR}/debugger"
13     "${JAVASCRIPTCORE_DIR}/interpreter"
14     "${JAVASCRIPTCORE_DIR}/jit"
15     "${JAVASCRIPTCORE_DIR}/llint"
16     "${JAVASCRIPTCORE_DIR}/parser"
17     "${JAVASCRIPTCORE_DIR}/profiler"
18     "${JAVASCRIPTCORE_DIR}/runtime"
19     "${JAVASCRIPTCORE_DIR}/tools"
20     "${JAVASCRIPTCORE_DIR}/yarr"
21     "${WTF_DIR}"
22     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
23     "${CMAKE_SOURCE_DIR}/Source"
24 )
25
26 SET(JavaScriptCore_SOURCES
27     API/JSBase.cpp
28     API/JSCallbackConstructor.cpp
29     API/JSCallbackFunction.cpp
30     API/JSCallbackObject.cpp
31     API/JSClassRef.cpp
32     API/JSContextRef.cpp
33     API/JSObjectRef.cpp
34     API/JSProfilerPrivate.cpp
35     API/JSStringRef.cpp
36     API/JSValueRef.cpp
37     API/JSWeakObjectMapRefPrivate.cpp
38     API/OpaqueJSString.cpp
39     
40     assembler/LinkBuffer.cpp
41
42     bytecode/CallLinkInfo.cpp
43     bytecode/CallLinkStatus.cpp
44     bytecode/CodeBlock.cpp
45     bytecode/DFGExitProfile.cpp
46     bytecode/ExecutionCounter.cpp
47     bytecode/GetByIdStatus.cpp
48     bytecode/JumpTable.cpp
49     bytecode/LazyOperandValueProfile.cpp
50     bytecode/MethodCallLinkInfo.cpp
51     bytecode/MethodCallLinkStatus.cpp
52     bytecode/MethodOfGettingAValueProfile.cpp
53     bytecode/Opcode.cpp
54     bytecode/PolymorphicPutByIdList.cpp
55     bytecode/SpeculatedType.cpp
56     bytecode/PutByIdStatus.cpp
57     bytecode/ResolveGlobalStatus.cpp
58     bytecode/SamplingTool.cpp
59     bytecode/StructureStubClearingWatchpoint.cpp
60     bytecode/StructureStubInfo.cpp
61     bytecode/Watchpoint.cpp
62
63     bytecompiler/BytecodeGenerator.cpp
64     bytecompiler/NodesCodegen.cpp
65
66     dfg/DFGAbstractState.cpp
67     dfg/DFGArgumentsSimplificationPhase.cpp
68     dfg/DFGAssemblyHelpers.cpp
69     dfg/DFGByteCodeParser.cpp
70     dfg/DFGCapabilities.cpp
71     dfg/DFGCFAPhase.cpp
72     dfg/DFGCFGSimplificationPhase.cpp
73     dfg/DFGConstantFoldingPhase.cpp
74     dfg/DFGCorrectableJumpPoint.cpp
75     dfg/DFGCSEPhase.cpp
76     dfg/DFGDisassembler.cpp
77     dfg/DFGDominators.cpp
78     dfg/DFGDriver.cpp
79     dfg/DFGFixupPhase.cpp
80     dfg/DFGGraph.cpp
81     dfg/DFGJITCompiler.cpp
82     dfg/DFGMinifiedNode.cpp
83     dfg/DFGNodeFlags.cpp
84     dfg/DFGOSREntry.cpp
85     dfg/DFGOSRExit.cpp
86     dfg/DFGOSRExitCompiler.cpp
87     dfg/DFGOSRExitCompiler32_64.cpp
88     dfg/DFGOSRExitCompiler64.cpp
89     dfg/DFGOperations.cpp
90     dfg/DFGPhase.cpp
91     dfg/DFGPredictionPropagationPhase.cpp
92     dfg/DFGRedundantPhiEliminationPhase.cpp
93     dfg/DFGRepatch.cpp
94     dfg/DFGSpeculativeJIT.cpp
95     dfg/DFGSpeculativeJIT32_64.cpp
96     dfg/DFGSpeculativeJIT64.cpp
97     dfg/DFGStructureCheckHoistingPhase.cpp
98     dfg/DFGThunks.cpp
99     dfg/DFGValueSource.cpp
100     dfg/DFGVariableEvent.cpp
101     dfg/DFGVariableEventStream.cpp
102     dfg/DFGValidate.cpp
103     dfg/DFGVirtualRegisterAllocationPhase.cpp
104
105     heap/BlockAllocator.cpp
106     heap/CopiedSpace.cpp
107     heap/ConservativeRoots.cpp
108     heap/DFGCodeBlocks.cpp
109     heap/HandleSet.cpp
110     heap/HandleStack.cpp
111     heap/Heap.cpp
112     heap/HeapTimer.cpp
113     heap/IncrementalSweeper.cpp
114     heap/JITStubRoutineSet.cpp
115     heap/MachineStackMarker.cpp
116     heap/MarkedAllocator.cpp
117     heap/MarkedBlock.cpp
118     heap/MarkedSpace.cpp
119     heap/MarkStack.cpp
120     heap/WeakSet.cpp
121     heap/WeakHandleOwner.cpp
122     heap/WeakBlock.cpp
123
124     debugger/Debugger.cpp
125     debugger/DebuggerActivation.cpp
126     debugger/DebuggerCallFrame.cpp
127     
128     interpreter/AbstractPC.cpp
129     interpreter/CallFrame.cpp
130     interpreter/Interpreter.cpp
131     interpreter/RegisterFile.cpp
132
133     jit/ExecutableAllocator.cpp
134     jit/HostCallReturnValue.cpp
135     jit/GCAwareJITStubRoutine.cpp
136     jit/JITArithmetic32_64.cpp
137     jit/JITArithmetic.cpp
138     jit/JITCall32_64.cpp
139     jit/JITCall.cpp
140     jit/JIT.cpp
141     jit/JITExceptions.cpp
142     jit/JITOpcodes32_64.cpp
143     jit/JITOpcodes.cpp
144     jit/JITPropertyAccess32_64.cpp
145     jit/JITPropertyAccess.cpp
146     jit/JITStubRoutine.cpp
147     jit/JITStubs.cpp
148     jit/JumpReplacementWatchpoint.cpp
149     jit/ThunkGenerators.cpp
150
151     parser/Lexer.cpp
152     parser/Nodes.cpp
153     parser/Parser.cpp
154     parser/ParserArena.cpp
155     parser/SourceProviderCache.cpp
156
157     profiler/Profile.cpp
158     profiler/ProfileGenerator.cpp
159     profiler/ProfileNode.cpp
160     profiler/Profiler.cpp
161
162     runtime/ArgList.cpp
163     runtime/Arguments.cpp
164     runtime/ArrayConstructor.cpp
165     runtime/ArrayPrototype.cpp
166     runtime/BooleanConstructor.cpp
167     runtime/BooleanObject.cpp
168     runtime/BooleanPrototype.cpp
169     runtime/CallData.cpp
170     runtime/CommonIdentifiers.cpp
171     runtime/Completion.cpp
172     runtime/ConstructData.cpp
173     runtime/DateConstructor.cpp
174     runtime/DateConversion.cpp
175     runtime/DateInstance.cpp
176     runtime/DatePrototype.cpp
177     runtime/Error.cpp
178     runtime/ErrorConstructor.cpp
179     runtime/ErrorInstance.cpp
180     runtime/ErrorPrototype.cpp
181     runtime/ExceptionHelpers.cpp
182     runtime/Executable.cpp
183     runtime/FunctionConstructor.cpp
184     runtime/FunctionPrototype.cpp
185     runtime/GCActivityCallback.cpp
186     runtime/GetterSetter.cpp
187     runtime/Identifier.cpp
188     runtime/InitializeThreading.cpp
189     runtime/InternalFunction.cpp
190     runtime/JSActivation.cpp
191     runtime/JSAPIValueWrapper.cpp
192     runtime/JSArray.cpp
193     runtime/JSCell.cpp
194     runtime/JSDateMath.cpp
195     runtime/JSFunction.cpp
196     runtime/JSBoundFunction.cpp
197     runtime/JSGlobalData.cpp
198     runtime/JSGlobalObject.cpp
199     runtime/JSGlobalObjectFunctions.cpp
200     runtime/JSGlobalThis.cpp
201     runtime/JSLock.cpp
202     runtime/JSNotAnObject.cpp
203     runtime/JSObject.cpp
204     runtime/JSONObject.cpp
205     runtime/JSPropertyNameIterator.cpp
206     runtime/JSSegmentedVariableObject.cpp
207     runtime/JSStaticScopeObject.cpp
208     runtime/JSString.cpp
209     runtime/JSStringJoiner.cpp
210     runtime/JSSymbolTableObject.cpp
211     runtime/JSValue.cpp
212     runtime/JSVariableObject.cpp
213     runtime/JSWrapperObject.cpp
214     runtime/LiteralParser.cpp
215     runtime/Lookup.cpp
216     runtime/MathObject.cpp
217     runtime/NameConstructor.cpp
218     runtime/NameConstructor.h
219     runtime/NameInstance.cpp
220     runtime/NameInstance.h
221     runtime/NamePrototype.cpp
222     runtime/NamePrototype.h
223     runtime/NativeErrorConstructor.cpp
224     runtime/NativeErrorPrototype.cpp
225     runtime/NumberConstructor.cpp
226     runtime/NumberObject.cpp
227     runtime/NumberPrototype.cpp
228     runtime/ObjectConstructor.cpp
229     runtime/ObjectPrototype.cpp
230     runtime/Operations.cpp
231     runtime/Options.cpp
232     runtime/PropertyDescriptor.cpp
233     runtime/PropertyNameArray.cpp
234     runtime/PropertySlot.cpp
235     runtime/RegExp.cpp
236     runtime/RegExpCache.cpp
237     runtime/RegExpConstructor.cpp
238     runtime/RegExpCachedResult.cpp
239     runtime/RegExpMatchesArray.cpp
240     runtime/RegExpObject.cpp
241     runtime/RegExpPrototype.cpp
242     runtime/ScopeChain.cpp
243     runtime/SmallStrings.cpp
244     runtime/StrictEvalActivation.cpp
245     runtime/StringConstructor.cpp
246     runtime/StringObject.cpp
247     runtime/StringPrototype.cpp
248     runtime/StringRecursionChecker.cpp
249     runtime/Structure.cpp
250     runtime/StructureChain.cpp
251     runtime/SymbolTable.cpp
252     runtime/TimeoutChecker.cpp
253     runtime/UString.cpp
254
255     tools/CodeProfile.cpp
256     tools/CodeProfiling.cpp
257
258     yarr/YarrCanonicalizeUCS2.cpp
259     yarr/YarrPattern.cpp
260     yarr/YarrInterpreter.cpp
261     yarr/YarrJIT.cpp
262     yarr/YarrSyntaxChecker.cpp
263 )
264
265 SET(JavaScriptCore_LUT_FILES
266     runtime/ArrayConstructor.cpp
267     runtime/ArrayPrototype.cpp
268     runtime/BooleanPrototype.cpp
269     runtime/DateConstructor.cpp
270     runtime/DatePrototype.cpp
271     runtime/ErrorPrototype.cpp
272     runtime/JSGlobalObject.cpp
273     runtime/JSONObject.cpp
274     runtime/MathObject.cpp
275     runtime/NamePrototype.cpp
276     runtime/NumberConstructor.cpp
277     runtime/NumberPrototype.cpp
278     runtime/ObjectConstructor.cpp
279     runtime/ObjectPrototype.cpp
280     runtime/RegExpConstructor.cpp
281     runtime/RegExpObject.cpp
282     runtime/RegExpPrototype.cpp
283     runtime/StringConstructor.cpp
284     runtime/StringPrototype.cpp
285 )
286
287 SET(JavaScriptCore_LIBRARIES
288     ${WTF_LIBRARY_NAME}
289 )
290
291 IF (ENABLE_LLINT)
292     # We cannot check for RUBY_FOUND because it is set only when the full package is installed and
293     # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
294     # for finding the only Ruby interpreter.
295     IF (NOT RUBY_EXECUTABLE)
296         MESSAGE(FATAL_ERROR "The Ruby interpreter is needed to generate LLInt files.")
297     ENDIF ()
298
299     SET(LLINT_ASM
300         llint/LowLevelInterpreter.asm
301         llint/LowLevelInterpreter32_64.asm
302         llint/LowLevelInterpreter64.asm
303     )
304
305     SET(OFFLINE_ASM
306         offlineasm/armv7.rb
307         offlineasm/ast.rb
308         offlineasm/backends.rb
309         offlineasm/cloop.rb
310         offlineasm/config.rb
311         offlineasm/instructions.rb
312         offlineasm/offsets.rb
313         offlineasm/opt.rb
314         offlineasm/parser.rb
315         offlineasm/registers.rb
316         offlineasm/self_hash.rb
317         offlineasm/settings.rb
318         offlineasm/transform.rb
319         offlineasm/x86.rb
320     )
321
322     ADD_CUSTOM_COMMAND(
323         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
324         MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
325         DEPENDS ${LLINT_ASM} ${OFFLINE_ASM}
326         COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
327         VERBATIM)
328
329 INCLUDE(TestCXXAcceptsFlag)
330 CHECK_CXX_ACCEPTS_FLAG("-dumpversion" CMAKE_CXX_ACCEPTS_DUMPVERSION)
331 IF (CMAKE_CXX_ACCEPTS_DUMPVERSION)
332     EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE COMPILER_VERSION)
333 ELSE ()
334     EXEC_PROGRAM("${CMAKE_CXX_COMPILER} -E -Wp,-dM - < /dev/null | grep '#define __VERSION__' | grep -E -o '[0-9]+\\.[0-9]+\\.?[0-9]+?'" OUTPUT_VARIABLE COMPILER_VERSION)
335 ENDIF ()
336
337 IF (${COMPILER_VERSION} VERSION_GREATER "4.7" OR ${COMPILER_VERSION} VERSION_EQUAL "4.7")
338     message(STATUS "Version >= 4.7")
339     SET(_flags)
340     SET(_file ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp)
341     GET_SOURCE_FILE_PROPERTY(_flags ${_file} COMPILE_FLAGS)
342     IF (NOT _flags)
343         SET(_flags "")
344     ENDIF ()
345     LIST (APPEND _flags " -gtoggle")
346     SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES COMPILE_FLAGS "${_flags}")
347
348     ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h)
349     ADD_EXECUTABLE(LLIntOffsetsExtractor ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp)
350     TARGET_LINK_LIBRARIES(LLIntOffsetsExtractor ${LLIntOffsetsExtractor_LIBRARIES} "-gtoggle")
351 ELSE ()
352     message(STATUS "Version < 4.7")
353     ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h)
354     ADD_EXECUTABLE(LLIntOffsetsExtractor ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp)
355 ENDIF ()
356
357     ADD_CUSTOM_COMMAND(
358         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
359         MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
360         DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM}
361         COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
362         VERBATIM)
363
364     ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h)
365     LIST(APPEND JavaScriptCore_SOURCES
366         llint/LLIntCLoop.cpp
367         llint/LLIntData.cpp
368         llint/LLIntEntrypoints.cpp
369         llint/LLIntExceptions.cpp
370         llint/LLIntSlowPaths.cpp
371         llint/LLIntThunks.cpp
372         llint/LowLevelInterpreter.cpp
373     )
374 ENDIF ()
375
376 # GENERATOR 1-A: LUT creator
377 FOREACH (_file ${JavaScriptCore_LUT_FILES})
378     GET_FILENAME_COMPONENT(_name ${_file} NAME_WE)
379     GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
380     LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
381 ENDFOREACH ()
382
383
384 # GENERATOR 1-B: particular LUT creator (for 1 file only)
385 GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h MAIN_DEPENDENCY)
386 LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
387
388 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
389 ADD_CUSTOM_COMMAND(
390     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
391     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_regex_tables
392     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
393     VERBATIM)
394 ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
395
396
397 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
398 ADD_CUSTOM_COMMAND(
399     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
400     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/KeywordLookupGenerator.py
401     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/KeywordLookupGenerator.py ${JAVASCRIPTCORE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
402     VERBATIM)
403 ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
404
405 IF (WTF_CPU_ARM)
406     LIST(APPEND JavaScriptCore_SOURCES
407         assembler/ARMAssembler.cpp
408         assembler/ARMv7Assembler.cpp
409         assembler/MacroAssemblerARM.cpp
410     )
411 ELSEIF (WTF_CPU_MIPS)
412 ELSEIF (WTF_CPU_X86)
413 ELSEIF (WTF_CPU_X86_64)
414 ELSE ()
415     MESSAGE(FATAL_ERROR "Unknown CPU")
416 ENDIF ()
417
418
419 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
420
421
422 ADD_SUBDIRECTORY(shell)
423
424 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
425 INCLUDE_DIRECTORIES(${JavaScriptCore_INCLUDE_DIRECTORIES})
426 ADD_DEFINITIONS(-DBUILDING_JavaScriptCore)
427 ADD_LIBRARY(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
428 TARGET_LINK_LIBRARIES(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARIES})
429 SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES FOLDER "JavaScriptCore")
430 SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
431
432 IF (SHARED_CORE)
433     SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
434     INSTALL(TARGETS ${JavaScriptCore_LIBRARY_NAME} DESTINATION "${LIB_INSTALL_DIR}")
435 ENDIF ()