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