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
38 API/JSWeakObjectMapRefPrivate.cpp
39 API/OpaqueJSString.cpp
41 assembler/MacroAssembler.cpp
42 assembler/LinkBuffer.cpp
44 bytecode/ArrayAllocationProfile.cpp
45 bytecode/ArrayProfile.cpp
46 bytecode/CallLinkInfo.cpp
47 bytecode/CallLinkStatus.cpp
48 bytecode/CodeBlock.cpp
49 bytecode/CodeBlockHash.cpp
50 bytecode/CodeOrigin.cpp
52 bytecode/DFGExitProfile.cpp
53 bytecode/ExecutionCounter.cpp
55 bytecode/GetByIdStatus.cpp
56 bytecode/JumpTable.cpp
57 bytecode/LazyOperandValueProfile.cpp
58 bytecode/MethodOfGettingAValueProfile.cpp
60 bytecode/PolymorphicPutByIdList.cpp
61 bytecode/PreciseJumpTargets.cpp
62 bytecode/PutByIdStatus.cpp
63 bytecode/SpeculatedType.cpp
64 bytecode/ReduceWhitespace.cpp
65 bytecode/ResolveGlobalStatus.cpp
66 bytecode/SamplingTool.cpp
67 bytecode/SpecialPointer.cpp
68 bytecode/StructureStubClearingWatchpoint.cpp
69 bytecode/StructureStubInfo.cpp
70 bytecode/UnlinkedCodeBlock.cpp
71 bytecode/Watchpoint.cpp
73 bytecompiler/BytecodeGenerator.cpp
74 bytecompiler/NodesCodegen.cpp
76 dfg/DFGAbstractState.cpp
77 dfg/DFGArgumentsSimplificationPhase.cpp
79 dfg/DFGAssemblyHelpers.cpp
80 dfg/DFGBackwardsPropagationPhase.cpp
81 dfg/DFGByteCodeParser.cpp
82 dfg/DFGCapabilities.cpp
85 dfg/DFGCFGSimplificationPhase.cpp
86 dfg/DFGCPSRethreadingPhase.cpp
87 dfg/DFGConstantFoldingPhase.cpp
90 dfg/DFGDisassembler.cpp
96 dfg/DFGJITCompiler.cpp
97 dfg/DFGLongLivedState.cpp
98 dfg/DFGMinifiedNode.cpp
103 dfg/DFGOSRExitCompiler.cpp
104 dfg/DFGOSRExitCompiler32_64.cpp
105 dfg/DFGOSRExitCompiler64.cpp
106 dfg/DFGOSRExitJumpPlaceholder.cpp
107 dfg/DFGOperations.cpp
109 dfg/DFGPredictionPropagationPhase.cpp
110 dfg/DFGPredictionInjectionPhase.cpp
112 dfg/DFGSpeculativeJIT.cpp
113 dfg/DFGSpeculativeJIT32_64.cpp
114 dfg/DFGSpeculativeJIT64.cpp
115 dfg/DFGStructureCheckHoistingPhase.cpp
117 dfg/DFGUnificationPhase.cpp
119 dfg/DFGValueSource.cpp
120 dfg/DFGVariableAccessDataDump.cpp
121 dfg/DFGVariableEvent.cpp
122 dfg/DFGVariableEventStream.cpp
124 dfg/DFGVirtualRegisterAllocationPhase.cpp
126 disassembler/Disassembler.cpp
128 heap/BlockAllocator.cpp
131 heap/ConservativeRoots.cpp
132 heap/DFGCodeBlocks.cpp
134 heap/GCThreadSharedData.cpp
138 heap/HeapStatistics.cpp
140 heap/IncrementalSweeper.cpp
141 heap/JITStubRoutineSet.cpp
142 heap/MachineStackMarker.cpp
144 heap/MarkedAllocator.cpp
152 heap/WeakHandleOwner.cpp
155 debugger/Debugger.cpp
156 debugger/DebuggerActivation.cpp
157 debugger/DebuggerCallFrame.cpp
159 interpreter/AbstractPC.cpp
160 interpreter/CallFrame.cpp
161 interpreter/Interpreter.cpp
162 interpreter/JSStack.cpp
163 interpreter/VMInspector.cpp
165 jit/ClosureCallStubRoutine.cpp
166 jit/ExecutableAllocator.cpp
167 jit/HostCallReturnValue.cpp
168 jit/GCAwareJITStubRoutine.cpp
169 jit/JITArithmetic32_64.cpp
170 jit/JITArithmetic.cpp
175 jit/JITDisassembler.cpp
176 jit/JITExceptions.cpp
177 jit/JITOpcodes32_64.cpp
179 jit/JITPropertyAccess32_64.cpp
180 jit/JITPropertyAccess.cpp
181 jit/JITStubRoutine.cpp
184 jit/JumpReplacementWatchpoint.cpp
185 jit/ThunkGenerators.cpp
190 parser/ParserArena.cpp
191 parser/SourceProvider.cpp
192 parser/SourceProviderCache.cpp
194 profiler/ProfilerBytecode.cpp
195 profiler/ProfilerBytecodeSequence.cpp
196 profiler/ProfilerBytecodes.cpp
197 profiler/ProfilerCompilation.cpp
198 profiler/ProfilerCompilationKind.cpp
199 profiler/ProfilerCompiledBytecode.cpp
200 profiler/ProfilerDatabase.cpp
201 profiler/ProfilerOrigin.cpp
202 profiler/ProfilerOriginStack.cpp
203 profiler/ProfilerOSRExit.cpp
204 profiler/ProfilerOSRExitSite.cpp
205 profiler/ProfilerProfiledBytecodes.cpp
207 profiler/ProfileGenerator.cpp
208 profiler/ProfileNode.cpp
209 profiler/LegacyProfiler.cpp
212 runtime/Arguments.cpp
213 runtime/ArrayConstructor.cpp
214 runtime/ArrayPrototype.cpp
215 runtime/BooleanConstructor.cpp
216 runtime/BooleanObject.cpp
217 runtime/BooleanPrototype.cpp
219 runtime/CodeCache.cpp
220 runtime/CodeSpecializationKind.cpp
221 runtime/CommonIdentifiers.cpp
222 runtime/Completion.cpp
223 runtime/ConstructData.cpp
224 runtime/DateConstructor.cpp
225 runtime/DateConversion.cpp
226 runtime/DateInstance.cpp
227 runtime/DatePrototype.cpp
229 runtime/ErrorConstructor.cpp
230 runtime/ErrorInstance.cpp
231 runtime/ErrorPrototype.cpp
232 runtime/ExceptionHelpers.cpp
233 runtime/Executable.cpp
234 runtime/FunctionConstructor.cpp
235 runtime/FunctionExecutableDump.cpp
236 runtime/FunctionPrototype.cpp
237 runtime/GCActivityCallback.cpp
238 runtime/GetterSetter.cpp
239 runtime/Identifier.cpp
240 runtime/IndexingType.cpp
241 runtime/InitializeThreading.cpp
242 runtime/InternalFunction.cpp
243 runtime/JSActivation.cpp
244 runtime/JSAPIValueWrapper.cpp
247 runtime/JSDateMath.cpp
248 runtime/JSFunction.cpp
249 runtime/JSBoundFunction.cpp
251 runtime/JSGlobalObject.cpp
252 runtime/JSGlobalObjectFunctions.cpp
255 runtime/JSNotAnObject.cpp
257 runtime/JSONObject.cpp
258 runtime/JSPropertyNameIterator.cpp
259 runtime/JSSegmentedVariableObject.cpp
260 runtime/JSNameScope.cpp
261 runtime/JSWithScope.cpp
264 runtime/JSStringJoiner.cpp
265 runtime/JSSymbolTableObject.cpp
266 runtime/JSCJSValue.cpp
267 runtime/JSVariableObject.cpp
268 runtime/JSWrapperObject.cpp
269 runtime/LiteralParser.cpp
271 runtime/MathObject.cpp
272 runtime/MemoryStatistics.cpp
273 runtime/NameConstructor.cpp
274 runtime/NameInstance.cpp
275 runtime/NamePrototype.cpp
276 runtime/NativeErrorConstructor.cpp
277 runtime/NativeErrorPrototype.cpp
278 runtime/NumberConstructor.cpp
279 runtime/NumberObject.cpp
280 runtime/NumberPrototype.cpp
281 runtime/ObjectConstructor.cpp
282 runtime/ObjectPrototype.cpp
283 runtime/Operations.cpp
285 runtime/PropertyDescriptor.cpp
286 runtime/PropertyNameArray.cpp
287 runtime/PropertySlot.cpp
288 runtime/PropertyTable.cpp
289 runtime/PrototypeMap.cpp
291 runtime/RegExpCache.cpp
292 runtime/RegExpConstructor.cpp
293 runtime/RegExpCachedResult.cpp
294 runtime/RegExpMatchesArray.cpp
295 runtime/RegExpObject.cpp
296 runtime/RegExpPrototype.cpp
297 runtime/SmallStrings.cpp
298 runtime/SparseArrayValueMap.cpp
299 runtime/StrictEvalActivation.cpp
300 runtime/StringConstructor.cpp
301 runtime/StringObject.cpp
302 runtime/StringPrototype.cpp
303 runtime/StringRecursionChecker.cpp
304 runtime/Structure.cpp
305 runtime/StructureRareData.cpp
306 runtime/StructureChain.cpp
307 runtime/SymbolTable.cpp
309 runtime/WatchdogNone.cpp
311 tools/CodeProfile.cpp
312 tools/CodeProfiling.cpp
314 yarr/YarrCanonicalizeUCS2.cpp
316 yarr/YarrInterpreter.cpp
318 yarr/YarrSyntaxChecker.cpp
321 set(JavaScriptCore_LUT_FILES
322 runtime/ArrayConstructor.cpp
323 runtime/ArrayPrototype.cpp
324 runtime/BooleanPrototype.cpp
325 runtime/DateConstructor.cpp
326 runtime/DatePrototype.cpp
327 runtime/ErrorPrototype.cpp
328 runtime/JSGlobalObject.cpp
329 runtime/JSONObject.cpp
330 runtime/MathObject.cpp
331 runtime/NamePrototype.cpp
332 runtime/NumberConstructor.cpp
333 runtime/NumberPrototype.cpp
334 runtime/ObjectConstructor.cpp
335 runtime/RegExpConstructor.cpp
336 runtime/RegExpObject.cpp
337 runtime/RegExpPrototype.cpp
338 runtime/StringConstructor.cpp
341 set(JavaScriptCore_LIBRARIES
345 if (WTF_USE_ICU_UNICODE)
346 list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
349 list(APPEND JavaScriptCore_LIBRARIES
350 ${ICU_I18N_LIBRARIES}
355 # We cannot check for RUBY_FOUND because it is set only when the full package is installed and
356 # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
357 # for finding the only Ruby interpreter.
358 if (NOT RUBY_EXECUTABLE)
359 message(FATAL_ERROR "The Ruby interpreter is needed to generate LLInt files.")
363 llint/LowLevelInterpreter.asm
364 llint/LowLevelInterpreter32_64.asm
365 llint/LowLevelInterpreter64.asm
371 offlineasm/backends.rb
374 offlineasm/instructions.rb
375 offlineasm/offsets.rb
378 offlineasm/registers.rb
380 offlineasm/self_hash.rb
381 offlineasm/settings.rb
382 offlineasm/transform.rb
387 OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
388 MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
389 DEPENDS ${LLINT_ASM} ${OFFLINE_ASM}
390 COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
393 # We add the header file directly to the ADD_EXECUTABLE call instead of setting the
394 # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb may
395 # not regenerate it in case the hash it calculates does not change.
396 # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMAND above have
397 # changed the command will always be called because the mtime of LLIntDesiredOffsets.h will
398 # always be older than that of its dependencies.
399 # Additionally, setting the OBJECT_DEPENDS property will make LLIntDesiredOffsets.h a Makefile
400 # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
401 # actually be run twice!
402 add_executable(LLIntOffsetsExtractor
403 ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
404 ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
406 target_link_libraries(LLIntOffsetsExtractor ${WTF_LIBRARY_NAME})
408 # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
409 # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
410 # that generates a checksum of the LLIntOffsetsExtractor binary, if the checksum of the new
411 # LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid
412 # running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch)
413 # after every asm.rb run.
415 OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
416 MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
417 DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM}
418 COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
419 COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
422 # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
423 # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
424 # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
425 # since it is used in the add_library() call at the end of this file.
426 list(APPEND JavaScriptCore_HEADERS
427 ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
429 list(APPEND JavaScriptCore_SOURCES
432 llint/LLIntEntrypoints.cpp
433 llint/LLIntExceptions.cpp
434 llint/LLIntSlowPaths.cpp
435 llint/LLIntThunks.cpp
436 llint/LowLevelInterpreter.cpp
440 set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
441 macro(GENERATE_HASH_LUT _input _output)
444 DEPENDS ${HASH_LUT_GENERATOR} ${_input}
445 COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} -i > ${_output}
447 list(APPEND JavaScriptCore_HEADERS ${_output})
450 # GENERATOR 1-A: LUT creator
451 foreach (_file ${JavaScriptCore_LUT_FILES})
452 get_filename_component(_name ${_file} NAME_WE)
453 GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
456 set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES
471 set(JavaScriptCore_FORWARDING_HEADERS_FILES
477 API/JSContextRefPrivate.h
479 API/JSObjectRefPrivate.h
480 API/JSScriptRefPrivate.h
483 API/JSStringRefBSTR.h
487 API/JSWeakObjectMapRefInternal.h
488 API/JSWeakObjectMapRefPrivate.h
491 API/WebKitAvailability.h
495 # GENERATOR 1-B: particular LUT creator (for 1 file only)
496 GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
498 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
500 OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
501 MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables
502 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
504 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
507 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
509 OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
510 MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
511 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
513 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
516 list(APPEND JavaScriptCore_SOURCES
517 assembler/ARMAssembler.cpp
518 assembler/ARMv7Assembler.cpp
519 assembler/MacroAssemblerARM.cpp
521 elseif (WTF_CPU_MIPS)
523 elseif (WTF_CPU_X86_64)
525 message(FATAL_ERROR "Unknown CPU")
529 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
531 WEBKIT_CREATE_FORWARDING_HEADERS(JavaScriptCore DIRECTORIES ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES} FILES ${JavaScriptCore_FORWARDING_HEADERS_FILES})
534 add_subdirectory(shell)
536 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
537 include_directories(${JavaScriptCore_INCLUDE_DIRECTORIES})
538 add_definitions(-DBUILDING_JavaScriptCore)
539 add_library(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
540 target_link_libraries(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARIES})
541 set_target_properties(${JavaScriptCore_LIBRARY_NAME} PROPERTIES FOLDER "JavaScriptCore")
542 set_target_properties(${JavaScriptCore_LIBRARY_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
545 set_target_properties(${JavaScriptCore_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
546 install(TARGETS ${JavaScriptCore_LIBRARY_NAME} DESTINATION "${LIB_INSTALL_DIR}")