1 SET(JavaScriptCore_INCLUDE_DIRECTORIES
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"
22 "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
23 "${CMAKE_SOURCE_DIR}/Source"
26 SET(JavaScriptCore_SOURCES
28 API/JSCallbackConstructor.cpp
29 API/JSCallbackFunction.cpp
30 API/JSCallbackObject.cpp
34 API/JSProfilerPrivate.cpp
37 API/JSWeakObjectMapRefPrivate.cpp
38 API/OpaqueJSString.cpp
40 assembler/LinkBuffer.cpp
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
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
63 bytecompiler/BytecodeGenerator.cpp
64 bytecompiler/NodesCodegen.cpp
66 dfg/DFGAbstractState.cpp
67 dfg/DFGArgumentsSimplificationPhase.cpp
68 dfg/DFGAssemblyHelpers.cpp
69 dfg/DFGByteCodeParser.cpp
70 dfg/DFGCapabilities.cpp
72 dfg/DFGCFGSimplificationPhase.cpp
73 dfg/DFGConstantFoldingPhase.cpp
74 dfg/DFGCorrectableJumpPoint.cpp
76 dfg/DFGDisassembler.cpp
81 dfg/DFGJITCompiler.cpp
82 dfg/DFGMinifiedNode.cpp
86 dfg/DFGOSRExitCompiler.cpp
87 dfg/DFGOSRExitCompiler32_64.cpp
88 dfg/DFGOSRExitCompiler64.cpp
91 dfg/DFGPredictionPropagationPhase.cpp
92 dfg/DFGRedundantPhiEliminationPhase.cpp
94 dfg/DFGSpeculativeJIT.cpp
95 dfg/DFGSpeculativeJIT32_64.cpp
96 dfg/DFGSpeculativeJIT64.cpp
97 dfg/DFGStructureCheckHoistingPhase.cpp
99 dfg/DFGValueSource.cpp
100 dfg/DFGVariableEvent.cpp
101 dfg/DFGVariableEventStream.cpp
103 dfg/DFGVirtualRegisterAllocationPhase.cpp
105 heap/BlockAllocator.cpp
107 heap/ConservativeRoots.cpp
108 heap/DFGCodeBlocks.cpp
113 heap/IncrementalSweeper.cpp
114 heap/JITStubRoutineSet.cpp
115 heap/MachineStackMarker.cpp
116 heap/MarkedAllocator.cpp
121 heap/WeakHandleOwner.cpp
124 debugger/Debugger.cpp
125 debugger/DebuggerActivation.cpp
126 debugger/DebuggerCallFrame.cpp
128 interpreter/AbstractPC.cpp
129 interpreter/CallFrame.cpp
130 interpreter/Interpreter.cpp
131 interpreter/RegisterFile.cpp
133 jit/ExecutableAllocator.cpp
134 jit/HostCallReturnValue.cpp
135 jit/GCAwareJITStubRoutine.cpp
136 jit/JITArithmetic32_64.cpp
137 jit/JITArithmetic.cpp
141 jit/JITExceptions.cpp
142 jit/JITOpcodes32_64.cpp
144 jit/JITPropertyAccess32_64.cpp
145 jit/JITPropertyAccess.cpp
146 jit/JITStubRoutine.cpp
148 jit/JumpReplacementWatchpoint.cpp
149 jit/ThunkGenerators.cpp
154 parser/ParserArena.cpp
155 parser/SourceProviderCache.cpp
158 profiler/ProfileGenerator.cpp
159 profiler/ProfileNode.cpp
160 profiler/Profiler.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
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
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
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
202 runtime/JSNotAnObject.cpp
204 runtime/JSONObject.cpp
205 runtime/JSPropertyNameIterator.cpp
206 runtime/JSSegmentedVariableObject.cpp
207 runtime/JSStaticScopeObject.cpp
209 runtime/JSStringJoiner.cpp
210 runtime/JSSymbolTableObject.cpp
212 runtime/JSVariableObject.cpp
213 runtime/JSWrapperObject.cpp
214 runtime/LiteralParser.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
232 runtime/PropertyDescriptor.cpp
233 runtime/PropertyNameArray.cpp
234 runtime/PropertySlot.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
255 tools/CodeProfile.cpp
256 tools/CodeProfiling.cpp
258 yarr/YarrCanonicalizeUCS2.cpp
260 yarr/YarrInterpreter.cpp
262 yarr/YarrSyntaxChecker.cpp
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
287 SET(JavaScriptCore_LIBRARIES
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.")
300 llint/LowLevelInterpreter.asm
301 llint/LowLevelInterpreter32_64.asm
302 llint/LowLevelInterpreter64.asm
308 offlineasm/backends.rb
311 offlineasm/instructions.rb
312 offlineasm/offsets.rb
315 offlineasm/registers.rb
316 offlineasm/self_hash.rb
317 offlineasm/settings.rb
318 offlineasm/transform.rb
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
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)
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)
337 IF (${COMPILER_VERSION} VERSION_GREATER "4.7" OR ${COMPILER_VERSION} VERSION_EQUAL "4.7")
338 message(STATUS "Version >= 4.7")
340 SET(_file ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp)
341 GET_SOURCE_FILE_PROPERTY(_flags ${_file} COMPILE_FLAGS)
345 LIST (APPEND _flags " -gtoggle")
346 SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES COMPILE_FLAGS "${_flags}")
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")
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)
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
364 ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h)
365 LIST(APPEND JavaScriptCore_SOURCES
368 llint/LLIntEntrypoints.cpp
369 llint/LLIntExceptions.cpp
370 llint/LLIntSlowPaths.cpp
371 llint/LLIntThunks.cpp
372 llint/LowLevelInterpreter.cpp
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)
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)
388 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
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
394 ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
397 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
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
403 ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
406 LIST(APPEND JavaScriptCore_SOURCES
407 assembler/ARMAssembler.cpp
408 assembler/ARMv7Assembler.cpp
409 assembler/MacroAssemblerARM.cpp
411 ELSEIF (WTF_CPU_MIPS)
413 ELSEIF (WTF_CPU_X86_64)
415 MESSAGE(FATAL_ERROR "Unknown CPU")
419 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
422 ADD_SUBDIRECTORY(shell)
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 "")
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}")