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