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