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