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