Roll out r108309, r108323, and r108326
[WebKit-https.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}/heap"
11     "${JAVASCRIPTCORE_DIR}/debugger"
12     "${JAVASCRIPTCORE_DIR}/interpreter"
13     "${JAVASCRIPTCORE_DIR}/jit"
14     "${JAVASCRIPTCORE_DIR}/parser"
15     "${JAVASCRIPTCORE_DIR}/profiler"
16     "${JAVASCRIPTCORE_DIR}/runtime"
17     "${JAVASCRIPTCORE_DIR}/tools"
18     "${JAVASCRIPTCORE_DIR}/yarr"
19     "${JAVASCRIPTCORE_DIR}/wtf"
20     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
21     "${CMAKE_SOURCE_DIR}/Source"
22 )
23
24 SET(JavaScriptCore_SOURCES
25     API/JSBase.cpp
26     API/JSCallbackConstructor.cpp
27     API/JSCallbackFunction.cpp
28     API/JSCallbackObject.cpp
29     API/JSClassRef.cpp
30     API/JSContextRef.cpp
31     API/JSObjectRef.cpp
32     API/JSProfilerPrivate.cpp
33     API/JSStringRef.cpp
34     API/JSValueRef.cpp
35     API/JSWeakObjectMapRefPrivate.cpp
36     API/OpaqueJSString.cpp
37
38     bytecode/CallLinkInfo.cpp
39     bytecode/CallLinkStatus.cpp
40     bytecode/CodeBlock.cpp
41     bytecode/DFGExitProfile.cpp
42     bytecode/GetByIdStatus.cpp
43     bytecode/JumpTable.cpp
44     bytecode/MethodCallLinkInfo.cpp
45     bytecode/MethodCallLinkStatus.cpp
46     bytecode/Opcode.cpp
47     bytecode/PolymorphicPutByIdList.cpp
48     bytecode/PredictedType.cpp
49     bytecode/PutByIdStatus.cpp
50     bytecode/SamplingTool.cpp
51     bytecode/StructureStubInfo.cpp
52     bytecode/ValueProfile.cpp
53
54     bytecompiler/BytecodeGenerator.cpp
55     bytecompiler/NodesCodegen.cpp
56
57     dfg/DFGAbstractState.cpp
58     dfg/DFGArithNodeFlagsInferencePhase.cpp
59     dfg/DFGAssemblyHelpers.cpp
60     dfg/DFGByteCodeParser.cpp
61     dfg/DFGCapabilities.cpp
62     dfg/DFGCFAPhase.cpp
63     dfg/DFGCorrectableJumpPoint.cpp
64     dfg/DFGCSEPhase.cpp
65     dfg/DFGDriver.cpp
66     dfg/DFGGraph.cpp
67     dfg/DFGJITCompiler.cpp
68     dfg/DFGOSREntry.cpp
69     dfg/DFGOSRExit.cpp
70     dfg/DFGOSRExitCompiler.cpp
71     dfg/DFGOSRExitCompiler32_64.cpp
72     dfg/DFGOSRExitCompiler64.cpp
73     dfg/DFGOperations.cpp
74     dfg/DFGPhase.cpp
75     dfg/DFGPredictionPropagationPhase.cpp
76     dfg/DFGRepatch.cpp
77     dfg/DFGSpeculativeJIT.cpp
78     dfg/DFGSpeculativeJIT32_64.cpp
79     dfg/DFGSpeculativeJIT64.cpp
80     dfg/DFGThunks.cpp
81     dfg/DFGVirtualRegisterAllocationPhase.cpp
82
83     heap/CopiedSpace.cpp
84     heap/DFGCodeBlocks.cpp
85     heap/Heap.cpp
86     heap/HandleHeap.cpp
87     heap/HandleStack.cpp
88     heap/MachineStackMarker.cpp
89     heap/MarkedAllocator.cpp
90     heap/MarkedBlock.cpp
91     heap/MarkedSpace.cpp
92     heap/ConservativeRoots.cpp
93     heap/MarkStack.cpp
94
95     debugger/Debugger.cpp
96     debugger/DebuggerActivation.cpp
97     debugger/DebuggerCallFrame.cpp
98     
99     interpreter/AbstractPC.cpp
100     interpreter/CallFrame.cpp
101     interpreter/Interpreter.cpp
102     interpreter/RegisterFile.cpp
103
104     jit/ExecutableAllocator.cpp
105     jit/JITArithmetic32_64.cpp
106     jit/JITArithmetic.cpp
107     jit/JITCall32_64.cpp
108     jit/JITCall.cpp
109     jit/JIT.cpp
110     jit/JITExceptions.cpp
111     jit/JITOpcodes32_64.cpp
112     jit/JITOpcodes.cpp
113     jit/JITPropertyAccess32_64.cpp
114     jit/JITPropertyAccess.cpp
115     jit/JITStubs.cpp
116     jit/ThunkGenerators.cpp
117
118     parser/Lexer.cpp
119     parser/Nodes.cpp
120     parser/Parser.cpp
121     parser/ParserArena.cpp
122     parser/SourceProviderCache.cpp
123
124     profiler/Profile.cpp
125     profiler/ProfileGenerator.cpp
126     profiler/ProfileNode.cpp
127     profiler/Profiler.cpp
128
129     runtime/ArgList.cpp
130     runtime/Arguments.cpp
131     runtime/ArrayConstructor.cpp
132     runtime/ArrayPrototype.cpp
133     runtime/BooleanConstructor.cpp
134     runtime/BooleanObject.cpp
135     runtime/BooleanPrototype.cpp
136     runtime/CallData.cpp
137     runtime/CommonIdentifiers.cpp
138     runtime/Completion.cpp
139     runtime/ConstructData.cpp
140     runtime/DateConstructor.cpp
141     runtime/DateConversion.cpp
142     runtime/DateInstance.cpp
143     runtime/DatePrototype.cpp
144     runtime/Error.cpp
145     runtime/ErrorConstructor.cpp
146     runtime/ErrorInstance.cpp
147     runtime/ErrorPrototype.cpp
148     runtime/ExceptionHelpers.cpp
149     runtime/Executable.cpp
150     runtime/FunctionConstructor.cpp
151     runtime/FunctionPrototype.cpp
152     runtime/GCActivityCallback.cpp
153     runtime/GetterSetter.cpp
154     runtime/Identifier.cpp
155     runtime/InitializeThreading.cpp
156     runtime/InternalFunction.cpp
157     runtime/JSActivation.cpp
158     runtime/JSAPIValueWrapper.cpp
159     runtime/JSArray.cpp
160     runtime/JSByteArray.cpp
161     runtime/JSCell.cpp
162     runtime/JSDateMath.cpp
163     runtime/JSFunction.cpp
164     runtime/JSBoundFunction.cpp
165     runtime/JSGlobalData.cpp
166     runtime/JSGlobalObject.cpp
167     runtime/JSGlobalObjectFunctions.cpp
168     runtime/JSGlobalThis.cpp
169     runtime/JSLock.cpp
170     runtime/JSNotAnObject.cpp
171     runtime/JSObject.cpp
172     runtime/JSONObject.cpp
173     runtime/JSPropertyNameIterator.cpp
174     runtime/JSStaticScopeObject.cpp
175     runtime/JSString.cpp
176     runtime/JSValue.cpp
177     runtime/JSVariableObject.cpp
178     runtime/JSWrapperObject.cpp
179     runtime/LiteralParser.cpp
180     runtime/Lookup.cpp
181     runtime/MathObject.cpp
182     runtime/NativeErrorConstructor.cpp
183     runtime/NativeErrorPrototype.cpp
184     runtime/NumberConstructor.cpp
185     runtime/NumberObject.cpp
186     runtime/NumberPrototype.cpp
187     runtime/ObjectConstructor.cpp
188     runtime/ObjectPrototype.cpp
189     runtime/Operations.cpp
190     runtime/Options.cpp
191     runtime/PropertyDescriptor.cpp
192     runtime/PropertyNameArray.cpp
193     runtime/PropertySlot.cpp
194     runtime/RegExp.cpp
195     runtime/RegExpCache.cpp
196     runtime/RegExpConstructor.cpp
197     runtime/RegExpObject.cpp
198     runtime/RegExpPrototype.cpp
199     runtime/ScopeChain.cpp
200     runtime/SmallStrings.cpp
201     runtime/StrictEvalActivation.cpp
202     runtime/StringConstructor.cpp
203     runtime/StringObject.cpp
204     runtime/StringPrototype.cpp
205     runtime/StringRecursionChecker.cpp
206     runtime/Structure.cpp
207     runtime/StructureChain.cpp
208     runtime/TimeoutChecker.cpp
209     runtime/UString.cpp
210
211     tools/CodeProfile.cpp
212     tools/CodeProfiling.cpp
213
214     yarr/YarrPattern.cpp
215     yarr/YarrInterpreter.cpp
216     yarr/YarrJIT.cpp
217     yarr/YarrSyntaxChecker.cpp
218 )
219
220 SET(JavaScriptCore_LUT_FILES
221     runtime/ArrayConstructor.cpp
222     runtime/ArrayPrototype.cpp
223     runtime/BooleanPrototype.cpp
224     runtime/DateConstructor.cpp
225     runtime/DatePrototype.cpp
226     runtime/ErrorPrototype.cpp
227     runtime/JSGlobalObject.cpp
228     runtime/JSONObject.cpp
229     runtime/MathObject.cpp
230     runtime/NumberConstructor.cpp
231     runtime/NumberPrototype.cpp
232     runtime/ObjectConstructor.cpp
233     runtime/ObjectPrototype.cpp
234     runtime/RegExpConstructor.cpp
235     runtime/RegExpObject.cpp
236     runtime/RegExpPrototype.cpp
237     runtime/StringConstructor.cpp
238     runtime/StringPrototype.cpp
239 )
240
241 SET(JavaScriptCore_LIBRARIES
242     ${WTF_LIBRARY_NAME}
243 )
244
245
246 # GENERATOR 1-A: LUT creator
247 FOREACH (_file ${JavaScriptCore_LUT_FILES})
248     GET_FILENAME_COMPONENT(_name ${_file} NAME_WE)
249     GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
250     LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
251 ENDFOREACH ()
252
253
254 # GENERATOR 1-B: particular LUT creator (for 1 file only)
255 GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h MAIN_DEPENDENCY)
256 LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
257
258 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
259 ADD_CUSTOM_COMMAND(
260     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
261     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_regex_tables
262     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
263     VERBATIM)
264 ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
265
266
267 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
268 ADD_CUSTOM_COMMAND(
269     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
270     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/KeywordLookupGenerator.py
271     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/KeywordLookupGenerator.py ${JAVASCRIPTCORE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
272     VERBATIM)
273 ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
274
275 IF (WTF_CPU_ARM)
276     LIST(APPEND JavaScriptCore_SOURCES
277         assembler/ARMAssembler.cpp
278         assembler/ARMv7Assembler.cpp
279         assembler/MacroAssemblerARM.cpp
280     )
281 ELSEIF (WTF_CPU_MIPS)
282 ELSEIF (WTF_CPU_X86)
283 ELSEIF (WTF_CPU_X86_64)
284 ELSE ()
285     MESSAGE(FATAL_ERROR "Unknown CPU")
286 ENDIF ()
287
288
289 INCLUDE_IF_EXISTS(${JAVASCRIPTCORE_DIR}/Platform${PORT}.cmake)
290
291
292 ADD_SUBDIRECTORY(wtf)
293 ADD_SUBDIRECTORY(shell)
294
295 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
296 INCLUDE_DIRECTORIES(${JavaScriptCore_INCLUDE_DIRECTORIES})
297 ADD_DEFINITIONS(-DBUILDING_JavaScriptCore)
298 ADD_LIBRARY(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
299 TARGET_LINK_LIBRARIES(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARIES})
300
301 IF (JavaScriptCore_LINK_FLAGS)
302     ADD_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} LINK_FLAGS "${JavaScriptCore_LINK_FLAGS}")
303 ENDIF ()
304
305 IF (SHARED_CORE)
306     SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
307     INSTALL(TARGETS ${JavaScriptCore_LIBRARY_NAME} DESTINATION lib)
308 ENDIF ()