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