29d9a9f2473f7b913cec48a99aa124408868f935
[WebKit-https.git] / Source / JavaScriptCore / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8.12)
2 include(WebKitCommon)
3 set_property(DIRECTORY . PROPERTY FOLDER "JavaScriptCore")
4
5 list(APPEND JavaScriptCore_UNIFIED_SOURCE_LIST_FILES
6     "Sources.txt"
7 )
8
9 set(JavaScriptCore_INCLUDE_DIRECTORIES
10     "${FORWARDING_HEADERS_DIR}"
11 )
12
13 set(JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES
14     "${CMAKE_BINARY_DIR}"
15     "${JAVASCRIPTCORE_DIR}"
16     "${JAVASCRIPTCORE_DIR}/API"
17     "${JAVASCRIPTCORE_DIR}/assembler"
18     "${JAVASCRIPTCORE_DIR}/b3"
19     "${JAVASCRIPTCORE_DIR}/b3/air"
20     "${JAVASCRIPTCORE_DIR}/bindings"
21     "${JAVASCRIPTCORE_DIR}/builtins"
22     "${JAVASCRIPTCORE_DIR}/bytecode"
23     "${JAVASCRIPTCORE_DIR}/bytecompiler"
24     "${JAVASCRIPTCORE_DIR}/dfg"
25     "${JAVASCRIPTCORE_DIR}/disassembler"
26     "${JAVASCRIPTCORE_DIR}/disassembler/ARM64"
27     "${JAVASCRIPTCORE_DIR}/disassembler/udis86"
28     "${JAVASCRIPTCORE_DIR}/domjit"
29     "${JAVASCRIPTCORE_DIR}/ftl"
30     "${JAVASCRIPTCORE_DIR}/heap"
31     "${JAVASCRIPTCORE_DIR}/debugger"
32     "${JAVASCRIPTCORE_DIR}/inspector"
33     "${JAVASCRIPTCORE_DIR}/inspector/agents"
34     "${JAVASCRIPTCORE_DIR}/inspector/augmentable"
35     "${JAVASCRIPTCORE_DIR}/inspector/remote"
36     "${JAVASCRIPTCORE_DIR}/interpreter"
37     "${JAVASCRIPTCORE_DIR}/jit"
38     "${JAVASCRIPTCORE_DIR}/llint"
39     "${JAVASCRIPTCORE_DIR}/parser"
40     "${JAVASCRIPTCORE_DIR}/profiler"
41     "${JAVASCRIPTCORE_DIR}/runtime"
42     "${JAVASCRIPTCORE_DIR}/tools"
43     "${JAVASCRIPTCORE_DIR}/wasm"
44     "${JAVASCRIPTCORE_DIR}/wasm/js"
45     "${JAVASCRIPTCORE_DIR}/yarr"
46     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
47     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector"
48     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/runtime"
49     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr"
50 )
51
52 if (USE_CAPSTONE)
53     list(APPEND JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/capstone/Source/include")
54 endif ()
55
56 set(JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES
57     "${ICU_INCLUDE_DIRS}"
58 )
59
60 set(JavaScriptCore_OBJECT_LUT_SOURCES
61     runtime/ArrayConstructor.cpp
62     runtime/ArrayIteratorPrototype.cpp
63     runtime/AsyncFromSyncIteratorPrototype.cpp
64     runtime/AsyncGeneratorPrototype.cpp
65     runtime/BigIntConstructor.cpp
66     runtime/BigIntPrototype.cpp
67     runtime/BooleanPrototype.cpp
68     runtime/DateConstructor.cpp
69     runtime/DatePrototype.cpp
70     runtime/ErrorPrototype.cpp
71     runtime/GeneratorPrototype.cpp
72     runtime/InspectorInstrumentationObject.cpp
73     runtime/IntlCollatorConstructor.cpp
74     runtime/IntlCollatorPrototype.cpp
75     runtime/IntlDateTimeFormatConstructor.cpp
76     runtime/IntlDateTimeFormatPrototype.cpp
77     runtime/IntlNumberFormatConstructor.cpp
78     runtime/IntlNumberFormatPrototype.cpp
79     runtime/IntlObject.cpp
80     runtime/IntlPluralRulesConstructor.cpp
81     runtime/IntlPluralRulesPrototype.cpp
82     runtime/JSDataViewPrototype.cpp
83     runtime/JSGlobalObject.cpp
84     runtime/JSInternalPromiseConstructor.cpp
85     runtime/JSModuleLoader.cpp
86     runtime/JSONObject.cpp
87     runtime/JSPromiseConstructor.cpp
88     runtime/JSPromisePrototype.cpp
89     runtime/MapPrototype.cpp
90     runtime/NumberConstructor.cpp
91     runtime/NumberPrototype.cpp
92     runtime/ObjectConstructor.cpp
93     runtime/ReflectObject.cpp
94     runtime/RegExpConstructor.cpp
95     runtime/RegExpPrototype.cpp
96     runtime/SetPrototype.cpp
97     runtime/StringConstructor.cpp
98     runtime/StringIteratorPrototype.cpp
99     runtime/StringPrototype.cpp
100     runtime/SymbolConstructor.cpp
101     runtime/SymbolPrototype.cpp
102
103     wasm/js/WebAssemblyCompileErrorConstructor.cpp
104     wasm/js/WebAssemblyCompileErrorPrototype.cpp
105     wasm/js/WebAssemblyInstanceConstructor.cpp
106     wasm/js/WebAssemblyInstancePrototype.cpp
107     wasm/js/WebAssemblyLinkErrorConstructor.cpp
108     wasm/js/WebAssemblyLinkErrorPrototype.cpp
109     wasm/js/WebAssemblyMemoryConstructor.cpp
110     wasm/js/WebAssemblyMemoryPrototype.cpp
111     wasm/js/WebAssemblyModuleConstructor.cpp
112     wasm/js/WebAssemblyModulePrototype.cpp
113     wasm/js/WebAssemblyPrototype.cpp
114     wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
115     wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
116     wasm/js/WebAssemblyTableConstructor.cpp
117     wasm/js/WebAssemblyTablePrototype.cpp
118 )
119
120 set(JavaScriptCore_LIBRARIES
121     WTF${DEBUG_SUFFIX}
122     ${ICU_I18N_LIBRARIES}
123 )
124
125 if (USE_CAPSTONE)
126     list(APPEND JavaScriptCore_LIBRARIES capstone)
127 endif ()
128
129 if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
130     list(APPEND JavaScriptCore_LIBRARIES atomic)
131 endif ()
132
133 set(JavaScriptCore_SCRIPTS_SOURCES_DIR "${JAVASCRIPTCORE_DIR}/Scripts")
134
135 # Globbing relies on the fact that generator-specific file names are prefixed with their directory.
136 # Top-level scripts should have a file extension, since they are invoked during the build.
137
138 set(JavaScriptCore_SCRIPTS_SOURCES_PATHS
139     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/*.pl
140     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/*.py
141     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/wkbuiltins/builtins*.py
142     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/wkbuiltins/wkbuiltins.py
143 )
144
145 # Force JavaScriptCore to run scripts from the same staging path as WebCore.
146 set(JavaScriptCore_SCRIPTS_DIR "${FORWARDING_HEADERS_DIR}/JavaScriptCore/Scripts")
147
148 file(MAKE_DIRECTORY ${JavaScriptCore_SCRIPTS_DIR})
149
150 # The directory flattening performed below mirrors what the Mac port does with private headers.
151
152 file(GLOB JavaScriptCore_SCRIPTS_SOURCES ${JavaScriptCore_SCRIPTS_SOURCES_PATHS})
153
154 foreach (_file ${JavaScriptCore_SCRIPTS_SOURCES})
155     get_filename_component(_script "${_file}" NAME)
156     add_custom_command(
157         OUTPUT ${JavaScriptCore_SCRIPTS_DIR}/${_script}
158         MAIN_DEPENDENCY ${_file}
159         WORKING_DIRECTORY ${DERIVED_SOURCES_DIR}
160         COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_file} ${JavaScriptCore_SCRIPTS_DIR}/${_script}
161         VERBATIM)
162     list(APPEND JavaScriptCore_SCRIPTS ${JavaScriptCore_SCRIPTS_DIR}/${_script})
163 endforeach ()
164
165 set(UDIS_GEN_DEP
166     disassembler/udis86/optable.xml
167     disassembler/udis86/ud_itab.py
168     disassembler/udis86/ud_opcode.py
169 )
170
171 add_custom_command(
172     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.c ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
173     DEPENDS ${UDIS_GEN_DEP}
174     WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
175     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/disassembler/udis86/ud_itab.py ${JAVASCRIPTCORE_DIR}/disassembler/udis86/optable.xml ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
176     VERBATIM)
177
178 list(APPEND JavaScriptCore_HEADERS
179     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
180 )
181
182 set(LLINT_ASM
183     llint/LowLevelInterpreter.asm
184     llint/LowLevelInterpreter32_64.asm
185     llint/LowLevelInterpreter64.asm
186 )
187
188 set(OFFLINE_ASM
189     offlineasm/arm.rb
190     offlineasm/arm64.rb
191     offlineasm/ast.rb
192     offlineasm/backends.rb
193     offlineasm/cloop.rb
194     offlineasm/config.rb
195     offlineasm/instructions.rb
196     offlineasm/mips.rb
197     offlineasm/offsets.rb
198     offlineasm/opt.rb
199     offlineasm/parser.rb
200     offlineasm/registers.rb
201     offlineasm/risc.rb
202     offlineasm/self_hash.rb
203     offlineasm/settings.rb
204     offlineasm/transform.rb
205     offlineasm/x86.rb
206 )
207
208 set(GENERATOR
209     generator/Argument.rb
210     generator/Assertion.rb
211     generator/DSL.rb
212     generator/Fits.rb
213     generator/GeneratedFile.rb
214     generator/Metadata.rb
215     generator/Opcode.rb
216     generator/OpcodeGroup.rb
217     generator/Options.rb
218     generator/Section.rb
219     generator/Template.rb
220     generator/Type.rb
221     generator/main.rb
222 )
223
224 add_custom_command(
225     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeIndices.h
226     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/generator/main.rb
227     DEPENDS ${GENERATOR} bytecode/BytecodeList.rb
228     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/generator/main.rb --bytecodes_h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h --init_bytecodes_asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm --bytecode_structs_h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h --bytecode_indices_h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeIndices.h ${JAVASCRIPTCORE_DIR}/bytecode/BytecodeList.rb
229     VERBATIM)
230
231
232 if (WTF_OS_MAC_OS_X)
233     execute_process(COMMAND bash -c "date +'%s'" OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
234 else ()
235     set(BUILD_TIME 0)
236 endif ()
237
238 file(WRITE ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeCacheVersion.h "#define JSC_BYTECODE_CACHE_VERSION ${BUILD_TIME}\n")
239
240 list(APPEND JavaScriptCore_HEADERS
241     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeCacheVersion.h
242     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h
243     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
244 )
245
246 if (WIN32)
247   set(OFFLINE_ASM_BACKEND "X86_WIN, X86_64_WIN, C_LOOP")
248 else ()
249     if (WTF_CPU_X86)
250         set(OFFLINE_ASM_BACKEND "X86")
251     elseif (WTF_CPU_X86_64)
252         set(OFFLINE_ASM_BACKEND "X86_64")
253     elseif (WTF_CPU_ARM64)
254         set(OFFLINE_ASM_BACKEND "ARM64")
255     elseif (ARM_THUMB2_DETECTED)
256         set(OFFLINE_ASM_BACKEND "ARMv7")
257     elseif (WTF_CPU_MIPS)
258         set(OFFLINE_ASM_BACKEND "MIPS")
259     endif ()
260
261     if (NOT ENABLE_JIT)
262         if (ENABLE_C_LOOP)
263             set(OFFLINE_ASM_BACKEND "C_LOOP")
264         endif ()
265     endif ()
266 endif ()
267
268 add_custom_command(
269     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredSettings.h
270     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_settings_extractor.rb
271     DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
272     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_settings_extractor.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredSettings.h ${OFFLINE_ASM_BACKEND}
273     VERBATIM)
274
275 add_custom_command(
276     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
277     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
278     DEPENDS LLIntSettingsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
279     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntSettingsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${OFFLINE_ASM_BACKEND}
280     VERBATIM)
281
282 # We add the header files directly to the ADD_EXECUTABLE call instead of setting the
283 # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb and
284 # generate-bytecode-files may not regenerate the .h files in case the hash it calculates does not change.
285 # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMANDs above have
286 # changed the command will always be called because the mtime of the .h files will
287 # always be older than that of their dependencies.
288 # Additionally, setting the OBJECT_DEPENDS property will make the .h files a Makefile
289 # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
290 # actually be run multiple times!
291 add_executable(LLIntSettingsExtractor
292     ${JAVASCRIPTCORE_DIR}/llint/LLIntSettingsExtractor.cpp
293     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredSettings.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h
294 )
295
296 add_executable(LLIntOffsetsExtractor
297     ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
298     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h
299 )
300
301 target_link_libraries(LLIntSettingsExtractor WTF)
302 add_dependencies(LLIntSettingsExtractor JavaScriptCoreForwardingHeaders)
303 target_link_libraries(LLIntOffsetsExtractor WTF)
304 add_dependencies(LLIntOffsetsExtractor JavaScriptCoreForwardingHeaders)
305
306 # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
307 # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
308 # that generates a checksum of the LLIntOffsetsExtractor binary, if the checksum of the new
309 # LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid
310 # running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch)
311 # after every asm.rb run.
312 if (MSVC AND NOT ENABLE_C_LOOP)
313     set(LLIntOutput LowLevelInterpreterWin.asm)
314     set(OFFLINE_ASM_ARGS --assembler=MASM)
315 else ()
316     set(LLIntOutput LLIntAssembly.h)
317 endif ()
318
319 add_custom_command(
320     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
321     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
322     DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
323     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput} ${OFFLINE_ASM_ARGS}
324     COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
325     WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
326     VERBATIM)
327
328 # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
329 # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
330 # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
331 # since it is used in the add_library() call at the end of this file.
332 if (MSVC AND NOT ENABLE_C_LOOP)
333     enable_language(ASM_MASM)
334     if (CMAKE_SIZEOF_VOID_P EQUAL 4)
335         # Win32 needs /safeseh with assembly, but Win64 does not.
336         set(MASM_EXECUTABLE ml)
337         set(LLINT_MASM_FLAGS /safeseh /c /Fo)
338     else ()
339         set(MASM_EXECUTABLE ml64)
340         set(LLINT_MASM_FLAGS /c /Fo)
341     endif ()
342     add_custom_command(
343         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.obj
344         DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
345         COMMAND ${MASM_EXECUTABLE} ${LLINT_MASM_FLAGS} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.obj ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
346         VERBATIM)
347     list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.obj)
348 else ()
349     list(APPEND JavaScriptCore_HEADERS
350         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
351     )
352 endif ()
353
354 # WebAssembly generator
355
356 macro(GENERATE_PYTHON _generator _additional_deps _input _output)
357     add_custom_command(
358         OUTPUT ${_output}
359         MAIN_DEPENDENCY ${_generator}
360         DEPENDS ${_input} ${_additional_deps}
361         COMMAND ${PYTHON_EXECUTABLE} ${_generator} ${_input} ${_output}
362         VERBATIM)
363     list(APPEND JavaScriptCore_HEADERS ${_output})
364     WEBKIT_ADD_SOURCE_DEPENDENCIES(${_input} ${_output})
365 endmacro()
366 GENERATE_PYTHON(${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasmOpsHeader.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasm.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/wasm.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WasmOps.h)
367 GENERATE_PYTHON(${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasmValidateInlinesHeader.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasm.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/wasm.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WasmValidateInlines.h)
368 GENERATE_PYTHON(${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasmB3IRGeneratorInlinesHeader.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasm.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/wasm.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WasmB3IRGeneratorInlines.h)
369
370 # LUT generator
371
372 set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
373 macro(GENERATE_HASH_LUT _input _output)
374     add_custom_command(
375         OUTPUT ${_output}
376         MAIN_DEPENDENCY ${HASH_LUT_GENERATOR}
377         DEPENDS ${_input}
378         COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} > ${_output}
379         VERBATIM)
380     list(APPEND JavaScriptCore_HEADERS ${_output})
381     WEBKIT_ADD_SOURCE_DEPENDENCIES(${_input} ${_output})
382 endmacro()
383
384 # GENERATOR 1-A: LUT creator
385
386 foreach (_file ${JavaScriptCore_OBJECT_LUT_SOURCES})
387     get_filename_component(_name ${_file} NAME_WE)
388     GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
389 endforeach ()
390
391 set(JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS
392     API/JSBase.h
393     API/JSContextRef.h
394     API/JSObjectRef.h
395     API/JSStringRef.h
396     API/JSTypedArray.h
397     API/JSValueRef.h
398     API/JavaScript.h
399     API/WebKitAvailability.h
400 )
401
402 set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
403     API/APICallbackFunction.h
404     API/APICast.h
405     API/APIUtils.h
406     API/JSAPIValueWrapper.h
407     API/JSAPIWrapperObject.h
408     API/JSBasePrivate.h
409     API/JSCTestRunnerUtils.h
410     API/JSCallbackConstructor.h
411     API/JSCallbackFunction.h
412     API/JSCallbackObject.h
413     API/JSCallbackObjectFunctions.h
414     API/JSClassRef.h
415     API/JSContextInternal.h
416     API/JSContextPrivate.h
417     API/JSContextRefInspectorSupport.h
418     API/JSContextRefInternal.h
419     API/JSContextRefPrivate.h
420     API/JSHeapFinalizerPrivate.h
421     API/JSManagedValueInternal.h
422     API/JSMarkingConstraintPrivate.h
423     API/JSObjectRefPrivate.h
424     API/JSRemoteInspector.h
425     API/JSRetainPtr.h
426     API/JSScriptRefPrivate.h
427     API/JSStringRefPrivate.h
428     API/JSValueInternal.h
429     API/JSVirtualMachineInternal.h
430     API/JSWeakObjectMapRefInternal.h
431     API/JSWeakObjectMapRefPrivate.h
432     API/JSWeakPrivate.h
433     API/JSWrapperMap.h
434     API/ObjCCallbackFunction.h
435     API/ObjcRuntimeExtras.h
436     API/OpaqueJSString.h
437
438     assembler/ARM64Assembler.h
439     assembler/ARMv7Assembler.h
440     assembler/AbortReason.h
441     assembler/AbstractMacroAssembler.h
442     assembler/AssemblerBuffer.h
443     assembler/AssemblerBufferWithConstantPool.h
444     assembler/AssemblerCommon.h
445     assembler/CPU.h
446     assembler/CodeLocation.h
447     assembler/LinkBuffer.h
448     assembler/MIPSAssembler.h
449     assembler/MacroAssembler.h
450     assembler/MacroAssemblerARM64.h
451     assembler/MacroAssemblerARMv7.h
452     assembler/MacroAssemblerCodeRef.h
453     assembler/MacroAssemblerHelpers.h
454     assembler/MacroAssemblerMIPS.h
455     assembler/MacroAssemblerX86.h
456     assembler/MacroAssemblerX86Common.h
457     assembler/MacroAssemblerX86_64.h
458     assembler/Printer.h
459     assembler/X86Assembler.h
460
461     bindings/ScriptFunctionCall.h
462     bindings/ScriptObject.h
463     bindings/ScriptValue.h
464
465     builtins/BuiltinNames.h
466     builtins/BuiltinUtils.h
467
468     bytecode/ArrayAllocationProfile.h
469     bytecode/ArrayProfile.h
470     bytecode/ByValInfo.h
471     bytecode/BytecodeConventions.h
472     bytecode/BytecodeIntrinsicRegistry.h
473     bytecode/CallEdge.h
474     bytecode/CallLinkInfo.h
475     bytecode/CallMode.h
476     bytecode/CallVariant.h
477     bytecode/CodeBlock.h
478     bytecode/CodeBlockHash.h
479     bytecode/CodeOrigin.h
480     bytecode/CodeType.h
481     bytecode/DFGExitProfile.h
482     bytecode/DataFormat.h
483     bytecode/DirectEvalCodeCache.h
484     bytecode/ExecutableInfo.h
485     bytecode/ExecutableToCodeBlockEdge.h
486     bytecode/ExecutionCounter.h
487     bytecode/ExitKind.h
488     bytecode/ExitingInlineKind.h
489     bytecode/ExitingJITType.h
490     bytecode/ExpressionRangeInfo.h
491     bytecode/HandlerInfo.h
492     bytecode/ICStatusMap.h
493     bytecode/InlineCallFrame.h
494     bytecode/Instruction.h
495     bytecode/InstructionStream.h
496     bytecode/InternalFunctionAllocationProfile.h
497     bytecode/JumpTable.h
498     bytecode/LLIntCallLinkInfo.h
499     bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h
500     bytecode/LazyOperandValueProfile.h
501     bytecode/MetadataTable.h
502     bytecode/ObjectAllocationProfile.h
503     bytecode/ObjectPropertyCondition.h
504     bytecode/Opcode.h
505     bytecode/OpcodeSize.h
506     bytecode/PropertyCondition.h
507     bytecode/PutByIdFlags.h
508     bytecode/SpecialPointer.h
509     bytecode/SpeculatedType.h
510     bytecode/StructureSet.h
511     bytecode/SuperSampler.h
512     bytecode/ToThisStatus.h
513     bytecode/TypeLocation.h
514     bytecode/UnlinkedCodeBlock.h
515     bytecode/UnlinkedEvalCodeBlock.h
516     bytecode/UnlinkedFunctionExecutable.h
517     bytecode/UnlinkedGlobalCodeBlock.h
518     bytecode/UnlinkedMetadataTable.h
519     bytecode/ValueProfile.h
520     bytecode/ValueRecovery.h
521     bytecode/VariableWriteFireDetail.h
522     bytecode/VirtualRegister.h
523     bytecode/Watchpoint.h
524
525     debugger/Breakpoint.h
526     debugger/Debugger.h
527     debugger/DebuggerCallFrame.h
528     debugger/DebuggerParseData.h
529     debugger/DebuggerPrimitives.h
530
531     dfg/DFGCommon.h
532     dfg/DFGCompilationMode.h
533     dfg/DFGMinifiedID.h
534
535     domjit/DOMJITAbstractHeap.h
536     domjit/DOMJITCallDOMGetterSnippet.h
537     domjit/DOMJITEffect.h
538     domjit/DOMJITGetterSetter.h
539     domjit/DOMJITHeapRange.h
540     domjit/DOMJITSignature.h
541
542     heap/AlignedMemoryAllocator.h
543     heap/AllocationFailureMode.h
544     heap/Allocator.h
545     heap/AllocatorInlines.h
546     heap/AllocatorForMode.h
547     heap/BlockDirectory.h
548     heap/BlockDirectoryInlines.h
549     heap/CellAttributes.h
550     heap/CellContainer.h
551     heap/CellContainerInlines.h
552     heap/CellState.h
553     heap/CollectionScope.h
554     heap/CollectorPhase.h
555     heap/CompleteSubspace.h
556     heap/CompleteSubspaceInlines.h
557     heap/ConstraintConcurrency.h
558     heap/ConstraintParallelism.h
559     heap/ConstraintVolatility.h
560     heap/DeferGC.h
561     heap/DeleteAllCodeEffort.h
562     heap/DestructionMode.h
563     heap/FastMallocAlignedMemoryAllocator.h
564     heap/FreeList.h
565     heap/FreeListInlines.h
566     heap/GCActivityCallback.h
567     heap/GCAssertions.h
568     heap/GCConductor.h
569     heap/GCDeferralContext.h
570     heap/GCIncomingRefCounted.h
571     heap/GCIncomingRefCountedInlines.h
572     heap/GCIncomingRefCountedSet.h
573     heap/GCLogging.h
574     heap/GCRequest.h
575     heap/GCSegmentedArray.h
576     heap/Handle.h
577     heap/HandleBlock.h
578     heap/HandleSet.h
579     heap/HandleTypes.h
580     heap/Heap.h
581     heap/HeapCell.h
582     heap/HeapCellInlines.h
583     heap/HeapCellType.h
584     heap/HeapFinalizerCallback.h
585     heap/HeapInlines.h
586     heap/HeapObserver.h
587     heap/HeapSnapshotBuilder.h
588     heap/IncrementalSweeper.h
589     heap/IsoCellSet.h
590     heap/IsoSubspace.h
591     heap/IsoSubspaceInlines.h
592     heap/IsoSubspacePerVM.h
593     heap/LargeAllocation.h
594     heap/LocalAllocator.h
595     heap/LocalAllocatorInlines.h
596     heap/LockDuringMarking.h
597     heap/MachineStackMarker.h
598     heap/MarkStack.h
599     heap/MarkedBlock.h
600     heap/MarkedBlockInlines.h
601     heap/MarkedBlockSet.h
602     heap/MarkedSpace.h
603     heap/MarkingConstraint.h
604     heap/MutatorState.h
605     heap/RegisterState.h
606     heap/RunningScope.h
607     heap/SimpleMarkingConstraint.h
608     heap/SlotVisitor.h
609     heap/SlotVisitorInlines.h
610     heap/Strong.h
611     heap/StrongInlines.h
612     heap/Subspace.h
613     heap/SubspaceInlines.h
614     heap/Synchronousness.h
615     heap/TinyBloomFilter.h
616     heap/VisitRaceKey.h
617     heap/Weak.h
618     heap/WeakBlock.h
619     heap/WeakHandleOwner.h
620     heap/WeakImpl.h
621     heap/WeakInlines.h
622     heap/WeakSet.h
623     heap/WeakSetInlines.h
624
625     inspector/ConsoleMessage.h
626     inspector/ContentSearchUtilities.h
627     inspector/IdentifiersFactory.h
628     inspector/InjectedScript.h
629     inspector/InjectedScriptBase.h
630     inspector/InjectedScriptHost.h
631     inspector/InjectedScriptManager.h
632     inspector/InjectedScriptModule.h
633     inspector/InspectorAgentBase.h
634     inspector/InspectorAgentRegistry.h
635     inspector/InspectorBackendDispatcher.h
636     inspector/InspectorEnvironment.h
637     inspector/InspectorFrontendChannel.h
638     inspector/InspectorFrontendRouter.h
639     inspector/InspectorProtocolTypes.h
640     inspector/InspectorTarget.h
641     inspector/PerGlobalObjectWrapperWorld.h
642     inspector/ScriptArguments.h
643     inspector/ScriptBreakpoint.h
644     inspector/ScriptCallFrame.h
645     inspector/ScriptCallStack.h
646     inspector/ScriptCallStackFactory.h
647     inspector/ScriptDebugListener.h
648     inspector/ScriptDebugServer.h
649
650     inspector/agents/InspectorAgent.h
651     inspector/agents/InspectorAuditAgent.h
652     inspector/agents/InspectorConsoleAgent.h
653     inspector/agents/InspectorDebuggerAgent.h
654     inspector/agents/InspectorHeapAgent.h
655     inspector/agents/InspectorRuntimeAgent.h
656     inspector/agents/InspectorScriptProfilerAgent.h
657     inspector/agents/InspectorTargetAgent.h
658
659     inspector/augmentable/AugmentableInspectorControllerClient.h
660
661     inspector/remote/RemoteAutomationTarget.h
662     inspector/remote/RemoteControllableTarget.h
663     inspector/remote/RemoteInspectionTarget.h
664     inspector/remote/RemoteInspector.h
665
666     interpreter/AbstractPC.h
667     interpreter/CallFrame.h
668     interpreter/CallFrameInlines.h
669     interpreter/CalleeBits.h
670     interpreter/EntryFrame.h
671     interpreter/FrameTracers.h
672     interpreter/Register.h
673     interpreter/ShadowChicken.h
674     interpreter/StackVisitor.h
675     interpreter/VMEntryRecord.h
676
677     jit/AssemblyHelpers.h
678     jit/CCallHelpers.h
679     jit/ExecutableAllocator.h
680     jit/FPRInfo.h
681     jit/GCAwareJITStubRoutine.h
682     jit/GPRInfo.h
683     jit/JITAllocator.h
684     jit/JITCode.h
685     jit/JITCodeMap.h
686     jit/JITCompilationEffort.h
687     jit/JITMathICForwards.h
688     jit/JITOperations.h
689     jit/JITStubRoutine.h
690     jit/JITThunks.h
691     jit/PolymorphicCallStubRoutine.h
692     jit/Reg.h
693     jit/RegisterAtOffset.h
694     jit/RegisterAtOffsetList.h
695     jit/RegisterSet.h
696     jit/Snippet.h
697     jit/SnippetParams.h
698     jit/SnippetReg.h
699     jit/SnippetSlowPathCalls.h
700     jit/SpillRegistersMode.h
701     jit/TagRegistersMode.h
702     jit/TempRegisterSet.h
703     jit/ThunkGenerator.h
704     jit/UnusedPointer.h
705
706     llint/LLIntOpcode.h
707
708     parser/Lexer.h
709     parser/ParserArena.h
710     parser/ParserError.h
711     parser/ParserModes.h
712     parser/ParserTokens.h
713     parser/SourceCode.h
714     parser/SourceProvider.h
715     parser/SourceProviderCache.h
716     parser/SourceProviderCacheItem.h
717     parser/UnlinkedSourceCode.h
718     parser/VariableEnvironment.h
719
720     profiler/ProfilerBytecode.h
721     profiler/ProfilerBytecodeSequence.h
722     profiler/ProfilerBytecodes.h
723     profiler/ProfilerCompilation.h
724     profiler/ProfilerCompilationKind.h
725     profiler/ProfilerCompiledBytecode.h
726     profiler/ProfilerDatabase.h
727     profiler/ProfilerEvent.h
728     profiler/ProfilerExecutionCounter.h
729     profiler/ProfilerJettisonReason.h
730     profiler/ProfilerOSRExit.h
731     profiler/ProfilerOSRExitSite.h
732     profiler/ProfilerOrigin.h
733     profiler/ProfilerOriginStack.h
734     profiler/ProfilerProfiledBytecodes.h
735     profiler/ProfilerUID.h
736
737     runtime/AbstractModuleRecord.h
738     runtime/ArgList.h
739     runtime/ArityCheckMode.h
740     runtime/ArrayBuffer.h
741     runtime/ArrayBufferSharingMode.h
742     runtime/ArrayBufferView.h
743     runtime/ArrayConventions.h
744     runtime/ArrayPrototype.h
745     runtime/ArrayStorage.h
746     runtime/AuxiliaryBarrier.h
747     runtime/AuxiliaryBarrierInlines.h
748     runtime/BasicBlockLocation.h
749     runtime/BatchedTransitionOptimizer.h
750     runtime/BigIntPrototype.h
751     runtime/BooleanObject.h
752     runtime/BooleanPrototype.h
753     runtime/Butterfly.h
754     runtime/ButterflyInlines.h
755     runtime/CagedBarrierPtr.h
756     runtime/CallData.h
757     runtime/CatchScope.h
758     runtime/ClassInfo.h
759     runtime/CodeSpecializationKind.h
760     runtime/CommonIdentifiers.h
761     runtime/CompilationResult.h
762     runtime/Completion.h
763     runtime/ConcurrentJSLock.h
764     runtime/ConfigFile.h
765     runtime/ConsoleClient.h
766     runtime/ConsoleTypes.h
767     runtime/ConstantMode.h
768     runtime/ConstructAbility.h
769     runtime/ConstructData.h
770     runtime/ControlFlowProfiler.h
771     runtime/CustomGetterSetter.h
772     runtime/DOMAnnotation.h
773     runtime/DOMAttributeGetterSetter.h
774     runtime/DataView.h
775     runtime/DateInstance.h
776     runtime/DateInstanceCache.h
777     runtime/DefinePropertyAttributes.h
778     runtime/DirectArgumentsOffset.h
779     runtime/DirectEvalExecutable.h
780     runtime/DisallowScope.h
781     runtime/DisallowVMReentry.h
782     runtime/DumpContext.h
783     runtime/EnumerationMode.h
784     runtime/Error.h
785     runtime/ErrorHandlingScope.h
786     runtime/ErrorInstance.h
787     runtime/ErrorPrototype.h
788     runtime/ErrorType.h
789     runtime/EvalExecutable.h
790     runtime/Exception.h
791     runtime/ExceptionEventLocation.h
792     runtime/ExceptionHelpers.h
793     runtime/ExceptionScope.h
794     runtime/ExecutableBase.h
795     runtime/ExecutableBaseInlines.h
796     runtime/Float32Array.h
797     runtime/Float64Array.h
798     runtime/FunctionConstructor.h
799     runtime/FunctionExecutable.h
800     runtime/FunctionHasExecutedCache.h
801     runtime/FunctionPrototype.h
802     runtime/FunctionRareData.h
803     runtime/GenericOffset.h
804     runtime/GenericTypedArrayView.h
805     runtime/GenericTypedArrayViewInlines.h
806     runtime/GetPutInfo.h
807     runtime/HashMapImpl.h
808     runtime/Identifier.h
809     runtime/IdentifierInlines.h
810     runtime/IndexingHeader.h
811     runtime/IndexingHeaderInlines.h
812     runtime/IndexingType.h
813     runtime/InferredValue.h
814     runtime/InitializeThreading.h
815     runtime/Int16Array.h
816     runtime/Int32Array.h
817     runtime/Int8Array.h
818     runtime/InternalFunction.h
819     runtime/Intrinsic.h
820     runtime/IterationKind.h
821     runtime/IterationStatus.h
822     runtime/IteratorOperations.h
823     runtime/IteratorPrototype.h
824     runtime/JSArray.h
825     runtime/JSArrayBuffer.h
826     runtime/JSArrayBufferPrototype.h
827     runtime/JSArrayBufferView.h
828     runtime/JSArrayBufferViewInlines.h
829     runtime/JSBigInt.h
830     runtime/JSCInlines.h
831     runtime/JSCJSValue.h
832     runtime/JSCJSValueInlines.h
833     runtime/JSCPoison.h
834     runtime/JSCPtrTag.h
835     runtime/JSCallee.h
836     runtime/JSCast.h
837     runtime/JSCell.h
838     runtime/JSCellInlines.h
839     runtime/JSDataView.h
840     runtime/JSDestructibleObject.h
841     runtime/JSDestructibleObjectHeapCellType.h
842     runtime/JSExportMacros.h
843     runtime/JSFunction.h
844     runtime/JSFunctionInlines.h
845     runtime/JSGenericTypedArrayView.h
846     runtime/JSGenericTypedArrayViewInlines.h
847     runtime/JSGenericTypedArrayViewPrototype.h
848     runtime/JSGenericTypedArrayViewPrototypeInlines.h
849     runtime/JSGlobalLexicalEnvironment.h
850     runtime/JSGlobalObject.h
851     runtime/JSGlobalObjectInlines.h
852     runtime/JSImmutableButterfly.h
853     runtime/JSInternalPromise.h
854     runtime/JSInternalPromiseDeferred.h
855     runtime/JSMicrotask.h
856     runtime/JSLock.h
857     runtime/JSMap.h
858     runtime/JSMapIterator.h
859     runtime/JSModuleLoader.h
860     runtime/JSModuleRecord.h
861     runtime/JSNativeStdFunction.h
862     runtime/JSNonDestructibleProxy.h
863     runtime/JSONObject.h
864     runtime/JSObject.h
865     runtime/JSObjectInlines.h
866     runtime/JSPromise.h
867     runtime/JSPromiseConstructor.h
868     runtime/JSPromiseDeferred.h
869     runtime/JSPropertyNameEnumerator.h
870     runtime/JSProxy.h
871     runtime/JSRunLoopTimer.h
872     runtime/JSScope.h
873     runtime/JSScriptFetchParameters.h
874     runtime/JSScriptFetcher.h
875     runtime/JSSegmentedVariableObject.h
876     runtime/JSSegmentedVariableObjectHeapCellType.h
877     runtime/JSSet.h
878     runtime/JSSetIterator.h
879     runtime/JSSourceCode.h
880     runtime/JSString.h
881     runtime/JSStringInlines.h
882     runtime/JSSymbolTableObject.h
883     runtime/JSType.h
884     runtime/JSTypeInfo.h
885     runtime/JSTypedArrays.h
886     runtime/JSWithScope.h
887     runtime/JSWrapperObject.h
888     runtime/LazyClassStructure.h
889     runtime/LazyProperty.h
890     runtime/Lookup.h
891     runtime/MatchResult.h
892     runtime/MathCommon.h
893     runtime/MemoryStatistics.h
894     runtime/Microtask.h
895     runtime/ModuleProgramExecutable.h
896     runtime/NativeExecutable.h
897     runtime/NativeFunction.h
898     runtime/NumberObject.h
899     runtime/NumberPrototype.h
900     runtime/NumericStrings.h
901     runtime/ObjectConstructor.h
902     runtime/ObjectInitializationScope.h
903     runtime/ObjectPrototype.h
904     runtime/Operations.h
905     runtime/Options.h
906     runtime/ParseInt.h
907     runtime/PrivateName.h
908     runtime/ProgramExecutable.h
909     runtime/PromiseDeferredTimer.h
910     runtime/PropertyDescriptor.h
911     runtime/PropertyMapHashTable.h
912     runtime/PropertyName.h
913     runtime/PropertyNameArray.h
914     runtime/PropertyOffset.h
915     runtime/PropertySlot.h
916     runtime/PropertyStorage.h
917     runtime/Protect.h
918     runtime/PrototypeKey.h
919     runtime/PureNaN.h
920     runtime/PutDirectIndexMode.h
921     runtime/PutPropertySlot.h
922     runtime/RegExp.h
923     runtime/RegExpCachedResult.h
924     runtime/RegExpGlobalData.h
925     runtime/RegExpKey.h
926     runtime/RegExpObject.h
927     runtime/RuntimeFlags.h
928     runtime/RuntimeType.h
929     runtime/SamplingProfiler.h
930     runtime/ScopeOffset.h
931     runtime/ScopedArgumentsTable.h
932     runtime/ScriptExecutable.h
933     runtime/ScriptFetchParameters.h
934     runtime/ScriptFetcher.h
935     runtime/SlowPathReturnType.h
936     runtime/SmallStrings.h
937     runtime/SourceOrigin.h
938     runtime/SparseArrayValueMap.h
939     runtime/StackAlignment.h
940     runtime/StackFrame.h
941     runtime/StringObject.h
942     runtime/StringPrototype.h
943     runtime/Structure.h
944     runtime/StructureCache.h
945     runtime/StructureChain.h
946     runtime/StructureIDBlob.h
947     runtime/StructureIDTable.h
948     runtime/StructureInlines.h
949     runtime/StructureRareData.h
950     runtime/StructureRareDataInlines.h
951     runtime/StructureTransitionTable.h
952     runtime/SubspaceAccess.h
953     runtime/Symbol.h
954     runtime/SymbolPrototype.h
955     runtime/SymbolTable.h
956     runtime/TemplateObjectDescriptor.h
957     runtime/TestRunnerUtils.h
958     runtime/ThrowScope.h
959     runtime/ToNativeFromValue.h
960     runtime/TypeError.h
961     runtime/TypeSet.h
962     runtime/TypedArrayAdaptors.h
963     runtime/TypedArrayController.h
964     runtime/TypedArrayInlines.h
965     runtime/TypedArrayType.h
966     runtime/TypedArrays.h
967     runtime/TypeofType.h
968     runtime/Uint16Array.h
969     runtime/Uint32Array.h
970     runtime/Uint8Array.h
971     runtime/Uint8ClampedArray.h
972     runtime/VM.h
973     runtime/VMEntryScope.h
974     runtime/VMInlines.h
975     runtime/VMTraps.h
976     runtime/VarOffset.h
977     runtime/Watchdog.h
978     runtime/WeakGCMap.h
979     runtime/WeakGCMapInlines.h
980     runtime/WriteBarrier.h
981     runtime/WriteBarrierInlines.h
982
983     wasm/WasmCodeBlock.h
984     wasm/WasmContext.h
985     wasm/WasmEmbedder.h
986     wasm/WasmExceptionType.h
987     wasm/WasmFaultSignalHandler.h
988     wasm/WasmIndexOrName.h
989     wasm/WasmMemory.h
990     wasm/WasmMemoryMode.h
991     wasm/WasmModule.h
992     wasm/WasmName.h
993     wasm/WasmNameSection.h
994     wasm/WasmPageCount.h
995     wasm/WasmTierUpCount.h
996
997     wasm/js/JSWebAssemblyModule.h
998     wasm/js/WebAssemblyPrototype.h
999
1000
1001     yarr/RegularExpression.h
1002     yarr/Yarr.h
1003     yarr/YarrErrorCode.h
1004     yarr/YarrInterpreter.h
1005     yarr/YarrJIT.h
1006     yarr/YarrParser.h
1007     yarr/YarrPattern.h
1008     yarr/YarrUnicodeProperties.h
1009 )
1010
1011 # GENERATOR 1-B: particular LUT creator (for 1 file only)
1012 GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
1013
1014 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr)
1015
1016 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
1017 add_custom_command(
1018     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h
1019     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/yarr/create_regex_tables
1020     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/yarr/create_regex_tables ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h
1021     VERBATIM)
1022 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h)
1023 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h)
1024
1025 add_custom_command(
1026     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h
1027     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/yarr/generateYarrUnicodePropertyTables.py
1028     DEPENDS ${JAVASCRIPTCORE_DIR}/yarr/hasher.py ${JAVASCRIPTCORE_DIR}/ucd/DerivedBinaryProperties.txt ${JAVASCRIPTCORE_DIR}/ucd/DerivedCoreProperties.txt ${JAVASCRIPTCORE_DIR}/ucd/DerivedNormalizationProps.txt ${JAVASCRIPTCORE_DIR}/ucd/PropList.txt ${JAVASCRIPTCORE_DIR}/ucd/PropertyAliases.txt ${JAVASCRIPTCORE_DIR}/ucd/PropertyValueAliases.txt ${JAVASCRIPTCORE_DIR}/ucd/ScriptExtensions.txt ${JAVASCRIPTCORE_DIR}/ucd/Scripts.txt ${JAVASCRIPTCORE_DIR}/ucd/UnicodeData.txt ${JAVASCRIPTCORE_DIR}/ucd/emoji-data.txt
1029     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/yarr/generateYarrUnicodePropertyTables.py ${JAVASCRIPTCORE_DIR}/ucd ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h
1030     VERBATIM)
1031 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h)
1032 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/UnicodePatternTables.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h)
1033
1034 add_custom_command(
1035     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/YarrCanonicalizeUnicode.cpp
1036     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/yarr/generateYarrCanonicalizeUnicode
1037     DEPENDS ${JAVASCRIPTCORE_DIR}/ucd/CaseFolding.txt
1038     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/yarr/generateYarrCanonicalizeUnicode ${JAVASCRIPTCORE_DIR}/ucd/CaseFolding.txt ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/YarrCanonicalizeUnicode.cpp
1039     VERBATIM)
1040
1041 #GENERATOR: "IntlCanonicalizeLanguage.h": tables used by Intl
1042 add_custom_command(
1043     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/IntlCanonicalizeLanguage.h
1044     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/Scripts/generateIntlCanonicalizeLanguage.py
1045     DEPENDS ${JAVASCRIPTCORE_DIR}/ucd/language-subtag-registry.txt
1046     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/Scripts/generateIntlCanonicalizeLanguage.py ${JAVASCRIPTCORE_DIR}/ucd/language-subtag-registry.txt ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/IntlCanonicalizeLanguage.h
1047     VERBATIM)
1048 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/IntlCanonicalizeLanguage.h)
1049 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/runtime/IntlObject.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/IntlCanonicalizeLanguage.h)
1050
1051 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
1052 add_custom_command(
1053     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
1054     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
1055     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table
1056     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
1057     VERBATIM)
1058 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
1059 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
1060
1061
1062 # Inspector Interfaces
1063
1064 set(JavaScriptCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
1065
1066 set(JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS
1067     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
1068     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator.py
1069     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator_templates.py
1070     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_js_backend_commands.py
1071     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_header.py
1072     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_implementation.py
1073     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_header.py
1074     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_implementation.py
1075     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_header.py
1076     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_implementation.py
1077     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator.py
1078     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator_templates.py
1079     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/__init__.py
1080     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/models.py
1081 )
1082
1083 set(JavaScriptCore_INSPECTOR_DOMAINS
1084     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ApplicationCache.json
1085     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Audit.json
1086     ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json
1087     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json
1088     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
1089     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOM.json
1090     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMDebugger.json
1091     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMStorage.json
1092     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Database.json
1093     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Debugger.json
1094     ${JAVASCRIPTCORE_DIR}/inspector/protocol/GenericTypes.json
1095     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Heap.json
1096     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Inspector.json
1097     ${JAVASCRIPTCORE_DIR}/inspector/protocol/LayerTree.json
1098     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Network.json
1099     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Page.json
1100     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Recording.json
1101     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Runtime.json
1102     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ScriptProfiler.json
1103     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Security.json
1104     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Target.json
1105     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Timeline.json
1106     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Worker.json
1107 )
1108
1109 if (ENABLE_INDEXED_DATABASE)
1110     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1111         ${JAVASCRIPTCORE_DIR}/inspector/protocol/IndexedDB.json
1112     )
1113 endif ()
1114
1115 if (ENABLE_RESOURCE_USAGE)
1116     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1117         ${JAVASCRIPTCORE_DIR}/inspector/protocol/CPUProfiler.json
1118         ${JAVASCRIPTCORE_DIR}/inspector/protocol/Memory.json
1119     )
1120 endif ()
1121
1122 if (ENABLE_SERVICE_WORKER)
1123     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1124         ${JAVASCRIPTCORE_DIR}/inspector/protocol/ServiceWorker.json
1125     )
1126 endif ()
1127
1128 add_custom_command(
1129     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1130     MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-combined-inspector-json.py
1131     DEPENDS ${JavaScriptCore_INSPECTOR_DOMAINS}
1132     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-combined-inspector-json.py ${JavaScriptCore_INSPECTOR_DOMAINS} > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1133     VERBATIM)
1134
1135 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
1136 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol)
1137 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
1138 add_custom_command(
1139     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
1140            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1141            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.cpp
1142            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1143            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.cpp
1144            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1145            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
1146     MAIN_DEPENDENCY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1147     DEPENDS ${JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS}
1148     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py --outputDir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector" --framework JavaScriptCore ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1149     VERBATIM)
1150
1151 # JSCBuiltins
1152
1153 set(BUILTINS_GENERATOR_SCRIPTS
1154     ${JavaScriptCore_SCRIPTS_DIR}/wkbuiltins.py
1155     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generator.py
1156     ${JavaScriptCore_SCRIPTS_DIR}/builtins_model.py
1157     ${JavaScriptCore_SCRIPTS_DIR}/builtins_templates.py
1158     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_combined_header.py
1159     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_combined_implementation.py
1160     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_header.py
1161     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_implementation.py
1162     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_wrapper_header.py
1163     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_wrapper_implementation.py
1164     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_internals_wrapper_header.py
1165     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_internals_wrapper_implementation.py
1166     ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
1167     ${JavaScriptCore_SCRIPTS_DIR}/lazywriter.py
1168 )
1169
1170 set(JavaScriptCore_BUILTINS_SOURCES
1171     ${JAVASCRIPTCORE_DIR}/builtins/AsyncFromSyncIteratorPrototype.js
1172     ${JAVASCRIPTCORE_DIR}/builtins/ArrayConstructor.js
1173     ${JAVASCRIPTCORE_DIR}/builtins/ArrayIteratorPrototype.js
1174     ${JAVASCRIPTCORE_DIR}/builtins/ArrayPrototype.js
1175     ${JAVASCRIPTCORE_DIR}/builtins/AsyncFunctionPrototype.js
1176     ${JAVASCRIPTCORE_DIR}/builtins/AsyncIteratorPrototype.js
1177     ${JAVASCRIPTCORE_DIR}/builtins/AsyncGeneratorPrototype.js
1178     ${JAVASCRIPTCORE_DIR}/builtins/DatePrototype.js
1179     ${JAVASCRIPTCORE_DIR}/builtins/FunctionPrototype.js
1180     ${JAVASCRIPTCORE_DIR}/builtins/GeneratorPrototype.js
1181     ${JAVASCRIPTCORE_DIR}/builtins/GlobalObject.js
1182     ${JAVASCRIPTCORE_DIR}/builtins/GlobalOperations.js
1183     ${JAVASCRIPTCORE_DIR}/builtins/InspectorInstrumentationObject.js
1184     ${JAVASCRIPTCORE_DIR}/builtins/InternalPromiseConstructor.js
1185     ${JAVASCRIPTCORE_DIR}/builtins/IteratorHelpers.js
1186     ${JAVASCRIPTCORE_DIR}/builtins/IteratorPrototype.js
1187     ${JAVASCRIPTCORE_DIR}/builtins/MapIteratorPrototype.js
1188     ${JAVASCRIPTCORE_DIR}/builtins/MapPrototype.js
1189     ${JAVASCRIPTCORE_DIR}/builtins/ModuleLoader.js
1190     ${JAVASCRIPTCORE_DIR}/builtins/NumberConstructor.js
1191     ${JAVASCRIPTCORE_DIR}/builtins/NumberPrototype.js
1192     ${JAVASCRIPTCORE_DIR}/builtins/ObjectConstructor.js
1193     ${JAVASCRIPTCORE_DIR}/builtins/PromiseConstructor.js
1194     ${JAVASCRIPTCORE_DIR}/builtins/PromiseOperations.js
1195     ${JAVASCRIPTCORE_DIR}/builtins/PromisePrototype.js
1196     ${JAVASCRIPTCORE_DIR}/builtins/ReflectObject.js
1197     ${JAVASCRIPTCORE_DIR}/builtins/RegExpPrototype.js
1198     ${JAVASCRIPTCORE_DIR}/builtins/SetIteratorPrototype.js
1199     ${JAVASCRIPTCORE_DIR}/builtins/SetPrototype.js
1200     ${JAVASCRIPTCORE_DIR}/builtins/StringConstructor.js
1201     ${JAVASCRIPTCORE_DIR}/builtins/StringIteratorPrototype.js
1202     ${JAVASCRIPTCORE_DIR}/builtins/StringPrototype.js
1203     ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayConstructor.js
1204     ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayPrototype.js
1205     ${JAVASCRIPTCORE_DIR}/builtins/WebAssemblyPrototype.js
1206 )
1207
1208 add_custom_command(
1209     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1210     MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
1211     DEPENDS ${JavaScriptCore_BUILTINS_SOURCES} ${BUILTINS_GENERATOR_SCRIPTS}
1212     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py --framework JavaScriptCore --output-directory ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} --combined ${JavaScriptCore_BUILTINS_SOURCES}
1213     VERBATIM)
1214
1215 list(APPEND JavaScriptCore_HEADERS
1216     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1217     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1218     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1219     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1220 )
1221
1222 add_custom_command(
1223     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcode.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcodeGenerated.h
1224     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/b3/air/AirOpcode.opcodes
1225     DEPENDS ${JAVASCRIPTCORE_DIR}/b3/air/opcode_generator.rb
1226     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/b3/air/opcode_generator.rb ${JAVASCRIPTCORE_DIR}/b3/air/AirOpcode.opcodes VERBATIM
1227     WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
1228 )
1229
1230 list(APPEND JavaScriptCore_HEADERS
1231     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcode.h
1232     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcodeGenerated.h
1233 )
1234
1235 add_custom_command(
1236     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1237     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js
1238     DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
1239     COMMAND ${CMAKE_COMMAND} -E echo "//# sourceURL=__InjectedScript_InjectedScriptSource.js" > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1240     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py < ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js >> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1241     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h
1242     VERBATIM)
1243
1244 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h)
1245
1246 if (WTF_CPU_X86_64)
1247     if (MSVC AND NOT ENABLE_C_LOOP)
1248         add_custom_command(
1249             OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
1250             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1251             COMMAND ml64 -nologo -c -Fo ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1252             VERBATIM)
1253
1254         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj)
1255     endif ()
1256 endif ()
1257
1258 WEBKIT_FRAMEWORK_DECLARE(JavaScriptCore)
1259 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
1260
1261 if (COMPILER_IS_GCC_OR_CLANG)
1262     # Avoid using fused multiply-add instructions since this could give different results
1263     # for e.g. parseInt depending on the platform and compilation flags.
1264     WEBKIT_ADD_TARGET_CXX_FLAGS(JavaScriptCore -ffp-contract=off)
1265
1266     # Avoid "variable tracking size limit exceeded"
1267     set_source_files_properties(builtins/BuiltinNames.cpp PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments)
1268 endif ()
1269
1270 WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
1271     FILES ${JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS}
1272     FLATTENED
1273 )
1274
1275 WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
1276     TARGET_NAME JavaScriptCorePrivateForwardingHeaders
1277     FILES ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS}
1278     DERIVED_SOURCE_DIRECTORIES ${DERIVED_SOURCES_DIR}/JavaScriptCore ${DERIVED_SOURCES_DIR}/JavaScriptCore/inspector
1279     FLATTENED
1280 )
1281
1282 target_include_directories(LLIntSettingsExtractor PRIVATE
1283     ${JavaScriptCore_INCLUDE_DIRECTORIES}
1284     ${JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES}
1285 )
1286 target_include_directories(LLIntSettingsExtractor SYSTEM PRIVATE ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
1287
1288 target_include_directories(LLIntOffsetsExtractor PRIVATE
1289     ${JavaScriptCore_INCLUDE_DIRECTORIES}
1290     ${JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES}
1291 )
1292 target_include_directories(LLIntOffsetsExtractor SYSTEM PRIVATE ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
1293
1294 add_subdirectory(shell)
1295
1296 WEBKIT_COMPUTE_SOURCES(JavaScriptCore)
1297 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
1298 WEBKIT_FRAMEWORK(JavaScriptCore)
1299
1300 if (NOT "${PORT}" STREQUAL "Mac")
1301     if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
1302         WEBKIT_POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE)
1303         set_target_properties(JavaScriptCore PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR})
1304         install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}")
1305     endif ()
1306 endif ()
1307
1308 # Force staging of shared scripts, even if they aren't directly used to build JavaScriptCore.
1309
1310 add_custom_target(stageSharedScripts DEPENDS ${JavaScriptCore_SCRIPTS})
1311 add_dependencies(JavaScriptCore stageSharedScripts ${JavaScriptCore_EXTRA_DEPENDENCIES})
1312
1313 if (MSVC)
1314     add_custom_command(
1315         TARGET JavaScriptCore
1316         PRE_BUILD
1317         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/auto-version.pl ${DERIVED_SOURCES_DIR}
1318         VERBATIM)
1319
1320     add_custom_command(
1321         TARGET JavaScriptCore
1322         POST_BUILD
1323         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/version-stamp.pl ${DERIVED_SOURCES_DIR} $<TARGET_FILE:JavaScriptCore>
1324         VERBATIM)
1325 endif ()