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