Disable usage of fused multiply-add instructions for JSC with compiler flag
[WebKit-https.git] / Source / JavaScriptCore / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8.12)
2 include(WebKitCommon)
3 set_property(DIRECTORY . PROPERTY FOLDER "JavaScriptCore")
4
5 list(APPEND JavaScriptCore_UNIFIED_SOURCE_LIST_FILES
6     "Sources.txt"
7 )
8
9 set(JavaScriptCore_INCLUDE_DIRECTORIES
10     "${FORWARDING_HEADERS_DIR}"
11 )
12
13 set(JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES
14     "${CMAKE_BINARY_DIR}"
15     "${JAVASCRIPTCORE_DIR}"
16     "${JAVASCRIPTCORE_DIR}/API"
17     "${JAVASCRIPTCORE_DIR}/assembler"
18     "${JAVASCRIPTCORE_DIR}/b3"
19     "${JAVASCRIPTCORE_DIR}/b3/air"
20     "${JAVASCRIPTCORE_DIR}/bindings"
21     "${JAVASCRIPTCORE_DIR}/builtins"
22     "${JAVASCRIPTCORE_DIR}/bytecode"
23     "${JAVASCRIPTCORE_DIR}/bytecompiler"
24     "${JAVASCRIPTCORE_DIR}/dfg"
25     "${JAVASCRIPTCORE_DIR}/disassembler"
26     "${JAVASCRIPTCORE_DIR}/disassembler/ARM64"
27     "${JAVASCRIPTCORE_DIR}/disassembler/ARMv7"
28     "${JAVASCRIPTCORE_DIR}/disassembler/udis86"
29     "${JAVASCRIPTCORE_DIR}/domjit"
30     "${JAVASCRIPTCORE_DIR}/ftl"
31     "${JAVASCRIPTCORE_DIR}/heap"
32     "${JAVASCRIPTCORE_DIR}/debugger"
33     "${JAVASCRIPTCORE_DIR}/inspector"
34     "${JAVASCRIPTCORE_DIR}/inspector/agents"
35     "${JAVASCRIPTCORE_DIR}/inspector/augmentable"
36     "${JAVASCRIPTCORE_DIR}/inspector/remote"
37     "${JAVASCRIPTCORE_DIR}/interpreter"
38     "${JAVASCRIPTCORE_DIR}/jit"
39     "${JAVASCRIPTCORE_DIR}/llint"
40     "${JAVASCRIPTCORE_DIR}/parser"
41     "${JAVASCRIPTCORE_DIR}/profiler"
42     "${JAVASCRIPTCORE_DIR}/runtime"
43     "${JAVASCRIPTCORE_DIR}/tools"
44     "${JAVASCRIPTCORE_DIR}/wasm"
45     "${JAVASCRIPTCORE_DIR}/wasm/js"
46     "${JAVASCRIPTCORE_DIR}/yarr"
47     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
48     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector"
49     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/runtime"
50     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr"
51 )
52
53 set(JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES
54     "${ICU_INCLUDE_DIRS}"
55 )
56
57 set(JavaScriptCore_OBJECT_LUT_SOURCES
58     runtime/ArrayConstructor.cpp
59     runtime/ArrayIteratorPrototype.cpp
60     runtime/AsyncGeneratorPrototype.cpp
61     runtime/BigIntConstructor.cpp
62     runtime/BigIntPrototype.cpp
63     runtime/BooleanPrototype.cpp
64     runtime/DateConstructor.cpp
65     runtime/DatePrototype.cpp
66     runtime/ErrorPrototype.cpp
67     runtime/GeneratorPrototype.cpp
68     runtime/InspectorInstrumentationObject.cpp
69     runtime/IntlCollatorConstructor.cpp
70     runtime/IntlCollatorPrototype.cpp
71     runtime/IntlDateTimeFormatConstructor.cpp
72     runtime/IntlDateTimeFormatPrototype.cpp
73     runtime/IntlNumberFormatConstructor.cpp
74     runtime/IntlNumberFormatPrototype.cpp
75     runtime/IntlPluralRulesConstructor.cpp
76     runtime/IntlPluralRulesPrototype.cpp
77     runtime/JSDataViewPrototype.cpp
78     runtime/JSGlobalObject.cpp
79     runtime/JSInternalPromiseConstructor.cpp
80     runtime/JSModuleLoader.cpp
81     runtime/JSONObject.cpp
82     runtime/JSPromiseConstructor.cpp
83     runtime/JSPromisePrototype.cpp
84     runtime/MapPrototype.cpp
85     runtime/NumberConstructor.cpp
86     runtime/NumberPrototype.cpp
87     runtime/ObjectConstructor.cpp
88     runtime/ReflectObject.cpp
89     runtime/RegExpConstructor.cpp
90     runtime/RegExpPrototype.cpp
91     runtime/SetPrototype.cpp
92     runtime/StringConstructor.cpp
93     runtime/StringIteratorPrototype.cpp
94     runtime/StringPrototype.cpp
95     runtime/SymbolConstructor.cpp
96     runtime/SymbolPrototype.cpp
97
98     wasm/js/WebAssemblyCompileErrorConstructor.cpp
99     wasm/js/WebAssemblyCompileErrorPrototype.cpp
100     wasm/js/WebAssemblyInstanceConstructor.cpp
101     wasm/js/WebAssemblyInstancePrototype.cpp
102     wasm/js/WebAssemblyLinkErrorConstructor.cpp
103     wasm/js/WebAssemblyLinkErrorPrototype.cpp
104     wasm/js/WebAssemblyMemoryConstructor.cpp
105     wasm/js/WebAssemblyMemoryPrototype.cpp
106     wasm/js/WebAssemblyModuleConstructor.cpp
107     wasm/js/WebAssemblyModulePrototype.cpp
108     wasm/js/WebAssemblyPrototype.cpp
109     wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
110     wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
111     wasm/js/WebAssemblyTableConstructor.cpp
112     wasm/js/WebAssemblyTablePrototype.cpp
113 )
114
115 set(JavaScriptCore_LIBRARIES
116     WTF${DEBUG_SUFFIX}
117     ${ICU_I18N_LIBRARIES}
118     ${LLVM_LIBRARIES}
119 )
120
121 # Since r228149, on MIPS we need to link with -latomic, because
122 # __atomic_fetch_add_8 is not available as a compiler intrinsic. It is
123 # available on other platforms (including 32-bit Arm), so the link with
124 # libatomic is only neede on MIPS.
125 if (WTF_CPU_MIPS)
126     list(APPEND JavaScriptCore_LIBRARIES
127         -latomic
128     )
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)
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)
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/ExitingJITType.h
444     bytecode/ExpressionRangeInfo.h
445     bytecode/HandlerInfo.h
446     bytecode/InlineCallFrame.h
447     bytecode/Instruction.h
448     bytecode/InternalFunctionAllocationProfile.h
449     bytecode/JumpTable.h
450     bytecode/LLIntCallLinkInfo.h
451     bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h
452     bytecode/LazyOperandValueProfile.h
453     bytecode/ObjectAllocationProfile.h
454     bytecode/ObjectPropertyCondition.h
455     bytecode/PropertyCondition.h
456     bytecode/PutByIdFlags.h
457     bytecode/SpecialPointer.h
458     bytecode/SpeculatedType.h
459     bytecode/StructureSet.h
460     bytecode/SuperSampler.h
461     bytecode/ToThisStatus.h
462     bytecode/TypeLocation.h
463     bytecode/UnlinkedCodeBlock.h
464     bytecode/UnlinkedEvalCodeBlock.h
465     bytecode/UnlinkedFunctionExecutable.h
466     bytecode/UnlinkedGlobalCodeBlock.h
467     bytecode/ValueProfile.h
468     bytecode/ValueRecovery.h
469     bytecode/VariableWriteFireDetail.h
470     bytecode/VirtualRegister.h
471     bytecode/Watchpoint.h
472
473     debugger/Breakpoint.h
474     debugger/Debugger.h
475     debugger/DebuggerCallFrame.h
476     debugger/DebuggerParseData.h
477     debugger/DebuggerPrimitives.h
478
479     dfg/DFGCommon.h
480     dfg/DFGCompilationMode.h
481     dfg/DFGMinifiedID.h
482
483     domjit/DOMJITAbstractHeap.h
484     domjit/DOMJITCallDOMGetterSnippet.h
485     domjit/DOMJITEffect.h
486     domjit/DOMJITGetterSetter.h
487     domjit/DOMJITHeapRange.h
488     domjit/DOMJITSignature.h
489
490     heap/AlignedMemoryAllocator.h
491     heap/AllocationFailureMode.h
492     heap/Allocator.h
493     heap/AllocatorForMode.h
494     heap/BlockDirectory.h
495     heap/BlockDirectoryInlines.h
496     heap/CellAttributes.h
497     heap/CellContainer.h
498     heap/CellContainerInlines.h
499     heap/CellState.h
500     heap/CollectionScope.h
501     heap/CollectorPhase.h
502     heap/CompleteSubspace.h
503     heap/ConstraintConcurrency.h
504     heap/ConstraintParallelism.h
505     heap/ConstraintVolatility.h
506     heap/DeferGC.h
507     heap/DeleteAllCodeEffort.h
508     heap/DestructionMode.h
509     heap/FastMallocAlignedMemoryAllocator.h
510     heap/FreeList.h
511     heap/FreeListInlines.h
512     heap/GCActivityCallback.h
513     heap/GCAssertions.h
514     heap/GCConductor.h
515     heap/GCDeferralContext.h
516     heap/GCIncomingRefCounted.h
517     heap/GCIncomingRefCountedInlines.h
518     heap/GCIncomingRefCountedSet.h
519     heap/GCLogging.h
520     heap/GCRequest.h
521     heap/GCSegmentedArray.h
522     heap/Handle.h
523     heap/HandleBlock.h
524     heap/HandleSet.h
525     heap/HandleTypes.h
526     heap/Heap.h
527     heap/HeapCell.h
528     heap/HeapCellInlines.h
529     heap/HeapCellType.h
530     heap/HeapFinalizerCallback.h
531     heap/HeapInlines.h
532     heap/HeapObserver.h
533     heap/IncrementalSweeper.h
534     heap/IsoCellSet.h
535     heap/IsoSubspace.h
536     heap/IsoSubspacePerVM.h
537     heap/LargeAllocation.h
538     heap/ListableHandler.h
539     heap/LocalAllocator.h
540     heap/LockDuringMarking.h
541     heap/MachineStackMarker.h
542     heap/MarkStack.h
543     heap/MarkedBlock.h
544     heap/MarkedBlockInlines.h
545     heap/MarkedBlockSet.h
546     heap/MarkedSpace.h
547     heap/MarkingConstraint.h
548     heap/MutatorState.h
549     heap/RegisterState.h
550     heap/RunningScope.h
551     heap/SimpleMarkingConstraint.h
552     heap/SlotVisitor.h
553     heap/SlotVisitorInlines.h
554     heap/Strong.h
555     heap/StrongInlines.h
556     heap/Subspace.h
557     heap/SubspaceInlines.h
558     heap/Synchronousness.h
559     heap/ThreadLocalCache.h
560     heap/TinyBloomFilter.h
561     heap/UnconditionalFinalizer.h
562     heap/VisitRaceKey.h
563     heap/Weak.h
564     heap/WeakBlock.h
565     heap/WeakHandleOwner.h
566     heap/WeakImpl.h
567     heap/WeakInlines.h
568     heap/WeakReferenceHarvester.h
569     heap/WeakSet.h
570     heap/WeakSetInlines.h
571
572     inspector/ConsoleMessage.h
573     inspector/ContentSearchUtilities.h
574     inspector/IdentifiersFactory.h
575     inspector/InjectedScript.h
576     inspector/InjectedScriptBase.h
577     inspector/InjectedScriptHost.h
578     inspector/InjectedScriptManager.h
579     inspector/InjectedScriptModule.h
580     inspector/InspectorAgentBase.h
581     inspector/InspectorAgentRegistry.h
582     inspector/InspectorBackendDispatcher.h
583     inspector/InspectorEnvironment.h
584     inspector/InspectorFrontendChannel.h
585     inspector/InspectorFrontendRouter.h
586     inspector/InspectorProtocolTypes.h
587     inspector/PerGlobalObjectWrapperWorld.h
588     inspector/ScriptArguments.h
589     inspector/ScriptBreakpoint.h
590     inspector/ScriptCallFrame.h
591     inspector/ScriptCallStack.h
592     inspector/ScriptCallStackFactory.h
593     inspector/ScriptDebugListener.h
594     inspector/ScriptDebugServer.h
595
596     inspector/agents/InspectorAgent.h
597     inspector/agents/InspectorConsoleAgent.h
598     inspector/agents/InspectorDebuggerAgent.h
599     inspector/agents/InspectorHeapAgent.h
600     inspector/agents/InspectorRuntimeAgent.h
601     inspector/agents/InspectorScriptProfilerAgent.h
602
603     inspector/augmentable/AugmentableInspectorControllerClient.h
604
605     inspector/remote/RemoteAutomationTarget.h
606     inspector/remote/RemoteControllableTarget.h
607     inspector/remote/RemoteInspectionTarget.h
608     inspector/remote/RemoteInspector.h
609
610     interpreter/AbstractPC.h
611     interpreter/CallFrame.h
612     interpreter/CalleeBits.h
613     interpreter/FrameTracers.h
614     interpreter/Register.h
615     interpreter/ShadowChicken.h
616     interpreter/StackVisitor.h
617     interpreter/VMEntryRecord.h
618
619     jit/AssemblyHelpers.h
620     jit/CCallHelpers.h
621     jit/ExecutableAllocator.h
622     jit/FPRInfo.h
623     jit/GCAwareJITStubRoutine.h
624     jit/GPRInfo.h
625     jit/JITAllocator.h
626     jit/JITCode.h
627     jit/JITCodeMap.h
628     jit/JITCompilationEffort.h
629     jit/JITMathICForwards.h
630     jit/JITOperations.h
631     jit/JITStubRoutine.h
632     jit/JITThunks.h
633     jit/PolymorphicCallStubRoutine.h
634     jit/Reg.h
635     jit/RegisterAtOffset.h
636     jit/RegisterAtOffsetList.h
637     jit/RegisterSet.h
638     jit/Snippet.h
639     jit/SnippetParams.h
640     jit/SnippetReg.h
641     jit/SnippetSlowPathCalls.h
642     jit/SpillRegistersMode.h
643     jit/TagRegistersMode.h
644     jit/TempRegisterSet.h
645     jit/ThunkGenerator.h
646     jit/UnusedPointer.h
647
648     parser/ParserError.h
649     parser/ParserModes.h
650     parser/ParserTokens.h
651     parser/SourceCode.h
652     parser/SourceProvider.h
653     parser/SourceProviderCache.h
654     parser/SourceProviderCacheItem.h
655     parser/UnlinkedSourceCode.h
656     parser/VariableEnvironment.h
657
658     profiler/ProfilerBytecode.h
659     profiler/ProfilerBytecodeSequence.h
660     profiler/ProfilerBytecodes.h
661     profiler/ProfilerCompilation.h
662     profiler/ProfilerCompilationKind.h
663     profiler/ProfilerCompiledBytecode.h
664     profiler/ProfilerDatabase.h
665     profiler/ProfilerEvent.h
666     profiler/ProfilerExecutionCounter.h
667     profiler/ProfilerJettisonReason.h
668     profiler/ProfilerOSRExit.h
669     profiler/ProfilerOSRExitSite.h
670     profiler/ProfilerOrigin.h
671     profiler/ProfilerOriginStack.h
672     profiler/ProfilerProfiledBytecodes.h
673     profiler/ProfilerUID.h
674
675     runtime/AbstractModuleRecord.h
676     runtime/ArgList.h
677     runtime/ArityCheckMode.h
678     runtime/ArrayBuffer.h
679     runtime/ArrayBufferSharingMode.h
680     runtime/ArrayBufferView.h
681     runtime/ArrayConventions.h
682     runtime/ArrayPrototype.h
683     runtime/ArrayStorage.h
684     runtime/AuxiliaryBarrier.h
685     runtime/AuxiliaryBarrierInlines.h
686     runtime/BasicBlockLocation.h
687     runtime/BatchedTransitionOptimizer.h
688     runtime/BigIntPrototype.h
689     runtime/BooleanObject.h
690     runtime/BooleanPrototype.h
691     runtime/Butterfly.h
692     runtime/ButterflyInlines.h
693     runtime/CagedBarrierPtr.h
694     runtime/CallData.h
695     runtime/CatchScope.h
696     runtime/ClassInfo.h
697     runtime/CodeSpecializationKind.h
698     runtime/CommonIdentifiers.h
699     runtime/CompilationResult.h
700     runtime/Completion.h
701     runtime/ConcurrentJSLock.h
702     runtime/ConfigFile.h
703     runtime/ConsoleClient.h
704     runtime/ConsoleTypes.h
705     runtime/ConstantMode.h
706     runtime/ConstructAbility.h
707     runtime/ConstructData.h
708     runtime/ControlFlowProfiler.h
709     runtime/CustomGetterSetter.h
710     runtime/DOMAnnotation.h
711     runtime/DOMAttributeGetterSetter.h
712     runtime/DataView.h
713     runtime/DateInstance.h
714     runtime/DateInstanceCache.h
715     runtime/DefinePropertyAttributes.h
716     runtime/DirectArgumentsOffset.h
717     runtime/DirectEvalExecutable.h
718     runtime/DisallowScope.h
719     runtime/DisallowVMReentry.h
720     runtime/DumpContext.h
721     runtime/EnumerationMode.h
722     runtime/Error.h
723     runtime/ErrorHandlingScope.h
724     runtime/ErrorInstance.h
725     runtime/ErrorPrototype.h
726     runtime/EvalExecutable.h
727     runtime/Exception.h
728     runtime/ExceptionEventLocation.h
729     runtime/ExceptionHelpers.h
730     runtime/ExceptionScope.h
731     runtime/ExecutableBase.h
732     runtime/Float32Array.h
733     runtime/Float64Array.h
734     runtime/FunctionConstructor.h
735     runtime/FunctionExecutable.h
736     runtime/FunctionHasExecutedCache.h
737     runtime/FunctionPrototype.h
738     runtime/FunctionRareData.h
739     runtime/GenericOffset.h
740     runtime/GenericTypedArrayView.h
741     runtime/GenericTypedArrayViewInlines.h
742     runtime/GetPutInfo.h
743     runtime/HashMapImpl.h
744     runtime/Identifier.h
745     runtime/IdentifierInlines.h
746     runtime/IndexingHeader.h
747     runtime/IndexingHeaderInlines.h
748     runtime/IndexingType.h
749     runtime/InferredStructure.h
750     runtime/InferredStructureWatchpoint.h
751     runtime/InferredType.h
752     runtime/InferredTypeTable.h
753     runtime/InferredValue.h
754     runtime/InitializeThreading.h
755     runtime/Int16Array.h
756     runtime/Int32Array.h
757     runtime/Int8Array.h
758     runtime/InternalFunction.h
759     runtime/Intrinsic.h
760     runtime/IterationKind.h
761     runtime/IterationStatus.h
762     runtime/IteratorOperations.h
763     runtime/IteratorPrototype.h
764     runtime/JSAPIValueWrapper.h
765     runtime/JSArray.h
766     runtime/JSArrayBuffer.h
767     runtime/JSArrayBufferPrototype.h
768     runtime/JSArrayBufferView.h
769     runtime/JSArrayBufferViewInlines.h
770     runtime/JSBigInt.h
771     runtime/JSCInlines.h
772     runtime/JSCJSValue.h
773     runtime/JSCJSValueInlines.h
774     runtime/JSCPoison.h
775     runtime/JSCPtrTag.h
776     runtime/JSCallee.h
777     runtime/JSCast.h
778     runtime/JSCell.h
779     runtime/JSCellInlines.h
780     runtime/JSDataView.h
781     runtime/JSDestructibleObject.h
782     runtime/JSDestructibleObjectHeapCellType.h
783     runtime/JSExportMacros.h
784     runtime/JSFunction.h
785     runtime/JSFunctionInlines.h
786     runtime/JSGenericTypedArrayView.h
787     runtime/JSGenericTypedArrayViewInlines.h
788     runtime/JSGenericTypedArrayViewPrototype.h
789     runtime/JSGenericTypedArrayViewPrototypeInlines.h
790     runtime/JSGlobalLexicalEnvironment.h
791     runtime/JSGlobalObject.h
792     runtime/JSGlobalObjectInlines.h
793     runtime/JSInternalPromise.h
794     runtime/JSInternalPromiseDeferred.h
795     runtime/JSLock.h
796     runtime/JSMap.h
797     runtime/JSMapIterator.h
798     runtime/JSModuleLoader.h
799     runtime/JSModuleRecord.h
800     runtime/JSNativeStdFunction.h
801     runtime/JSONObject.h
802     runtime/JSObject.h
803     runtime/JSObjectInlines.h
804     runtime/JSPromise.h
805     runtime/JSPromiseConstructor.h
806     runtime/JSPromiseDeferred.h
807     runtime/JSProxy.h
808     runtime/JSRunLoopTimer.h
809     runtime/JSScope.h
810     runtime/JSScriptFetchParameters.h
811     runtime/JSScriptFetcher.h
812     runtime/JSSegmentedVariableObject.h
813     runtime/JSSegmentedVariableObjectHeapCellType.h
814     runtime/JSSet.h
815     runtime/JSSetIterator.h
816     runtime/JSSourceCode.h
817     runtime/JSString.h
818     runtime/JSStringInlines.h
819     runtime/JSSymbolTableObject.h
820     runtime/JSType.h
821     runtime/JSTypeInfo.h
822     runtime/JSTypedArrays.h
823     runtime/JSWithScope.h
824     runtime/JSWrapperObject.h
825     runtime/LazyClassStructure.h
826     runtime/LazyProperty.h
827     runtime/Lookup.h
828     runtime/MatchResult.h
829     runtime/MathCommon.h
830     runtime/MemoryStatistics.h
831     runtime/Microtask.h
832     runtime/ModuleProgramExecutable.h
833     runtime/NativeExecutable.h
834     runtime/NativeFunction.h
835     runtime/NumberObject.h
836     runtime/NumberPrototype.h
837     runtime/NumericStrings.h
838     runtime/ObjectConstructor.h
839     runtime/ObjectInitializationScope.h
840     runtime/ObjectPrototype.h
841     runtime/Operations.h
842     runtime/Options.h
843     runtime/ParseInt.h
844     runtime/PrivateName.h
845     runtime/ProgramExecutable.h
846     runtime/PromiseDeferredTimer.h
847     runtime/PropertyDescriptor.h
848     runtime/PropertyMapHashTable.h
849     runtime/PropertyName.h
850     runtime/PropertyNameArray.h
851     runtime/PropertyOffset.h
852     runtime/PropertySlot.h
853     runtime/PropertyStorage.h
854     runtime/Protect.h
855     runtime/PrototypeKey.h
856     runtime/PureNaN.h
857     runtime/PutDirectIndexMode.h
858     runtime/PutPropertySlot.h
859     runtime/RegExp.h
860     runtime/RegExpKey.h
861     runtime/RegExpObject.h
862     runtime/RuntimeFlags.h
863     runtime/RuntimeType.h
864     runtime/SamplingProfiler.h
865     runtime/ScopeOffset.h
866     runtime/ScopedArgumentsTable.h
867     runtime/ScriptExecutable.h
868     runtime/ScriptFetchParameters.h
869     runtime/ScriptFetcher.h
870     runtime/SlowPathReturnType.h
871     runtime/SmallStrings.h
872     runtime/SourceOrigin.h
873     runtime/SparseArrayValueMap.h
874     runtime/StackAlignment.h
875     runtime/StackFrame.h
876     runtime/StringObject.h
877     runtime/StringPrototype.h
878     runtime/Structure.h
879     runtime/StructureCache.h
880     runtime/StructureChain.h
881     runtime/StructureIDBlob.h
882     runtime/StructureIDTable.h
883     runtime/StructureInlines.h
884     runtime/StructureRareData.h
885     runtime/StructureRareDataInlines.h
886     runtime/StructureTransitionTable.h
887     runtime/Symbol.h
888     runtime/SymbolPrototype.h
889     runtime/SymbolTable.h
890     runtime/TemplateObjectDescriptor.h
891     runtime/TestRunnerUtils.h
892     runtime/ThrowScope.h
893     runtime/ToNativeFromValue.h
894     runtime/TypeError.h
895     runtime/TypeSet.h
896     runtime/TypedArrayAdaptors.h
897     runtime/TypedArrayController.h
898     runtime/TypedArrayInlines.h
899     runtime/TypedArrayType.h
900     runtime/TypedArrays.h
901     runtime/TypeofType.h
902     runtime/Uint16Array.h
903     runtime/Uint32Array.h
904     runtime/Uint8Array.h
905     runtime/Uint8ClampedArray.h
906     runtime/VM.h
907     runtime/VMEntryScope.h
908     runtime/VMInlines.h
909     runtime/VMTraps.h
910     runtime/VarOffset.h
911     runtime/Watchdog.h
912     runtime/WeakGCMap.h
913     runtime/WeakGCMapInlines.h
914     runtime/WriteBarrier.h
915     runtime/WriteBarrierInlines.h
916
917     wasm/WasmCodeBlock.h
918     wasm/WasmContext.h
919     wasm/WasmEmbedder.h
920     wasm/WasmExceptionType.h
921     wasm/WasmFaultSignalHandler.h
922     wasm/WasmIndexOrName.h
923     wasm/WasmMemory.h
924     wasm/WasmMemoryMode.h
925     wasm/WasmModule.h
926     wasm/WasmName.h
927     wasm/WasmNameSection.h
928     wasm/WasmPageCount.h
929     wasm/WasmTierUpCount.h
930
931     wasm/js/JSWebAssemblyModule.h
932     wasm/js/WebAssemblyPrototype.h
933
934
935     yarr/RegularExpression.h
936     yarr/Yarr.h
937     yarr/YarrErrorCode.h
938     yarr/YarrInterpreter.h
939     yarr/YarrJIT.h
940     yarr/YarrParser.h
941     yarr/YarrPattern.h
942     yarr/YarrUnicodeProperties.h
943 )
944
945 # GENERATOR 1-B: particular LUT creator (for 1 file only)
946 GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
947
948 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr)
949
950 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
951 add_custom_command(
952     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h
953     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/yarr/create_regex_tables
954     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/yarr/create_regex_tables ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h
955     VERBATIM)
956 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h)
957 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/RegExpJitTables.h)
958
959 add_custom_command(
960     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h
961     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/Scripts/generateYarrUnicodePropertyTables.py
962     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
963     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/Scripts/generateYarrUnicodePropertyTables.py ${JAVASCRIPTCORE_DIR}/ucd ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h
964     VERBATIM)
965 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h)
966 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/UnicodePatternTables.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/UnicodePatternTables.h)
967
968 add_custom_command(
969     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/YarrCanonicalizeUnicode.cpp
970     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/yarr/generateYarrCanonicalizeUnicode
971     DEPENDS ${JAVASCRIPTCORE_DIR}/ucd/CaseFolding.txt
972     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/yarr/generateYarrCanonicalizeUnicode ${JAVASCRIPTCORE_DIR}/ucd/CaseFolding.txt ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/yarr/YarrCanonicalizeUnicode.cpp
973     VERBATIM)
974
975 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
976 add_custom_command(
977     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
978     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
979     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table
980     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
981     VERBATIM)
982 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
983 WEBKIT_ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
984
985
986 # Inspector Interfaces
987
988 set(JavaScriptCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
989
990 set(JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS
991     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
992     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator.py
993     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator_templates.py
994     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_js_backend_commands.py
995     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_header.py
996     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_implementation.py
997     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_header.py
998     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_implementation.py
999     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_header.py
1000     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_implementation.py
1001     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator.py
1002     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator_templates.py
1003     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/__init__.py
1004     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/models.py
1005 )
1006
1007 set(JavaScriptCore_INSPECTOR_DOMAINS
1008     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ApplicationCache.json
1009     ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json
1010     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json
1011     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
1012     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOM.json
1013     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMDebugger.json
1014     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMStorage.json
1015     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Database.json
1016     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Debugger.json
1017     ${JAVASCRIPTCORE_DIR}/inspector/protocol/GenericTypes.json
1018     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Heap.json
1019     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Inspector.json
1020     ${JAVASCRIPTCORE_DIR}/inspector/protocol/LayerTree.json
1021     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Network.json
1022     ${JAVASCRIPTCORE_DIR}/inspector/protocol/OverlayTypes.json
1023     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Page.json
1024     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Recording.json
1025     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Runtime.json
1026     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ScriptProfiler.json
1027     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Timeline.json
1028     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Worker.json
1029 )
1030
1031 if (ENABLE_INDEXED_DATABASE)
1032     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1033         ${JAVASCRIPTCORE_DIR}/inspector/protocol/IndexedDB.json
1034     )
1035 endif ()
1036
1037 if (ENABLE_RESOURCE_USAGE)
1038     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1039         ${JAVASCRIPTCORE_DIR}/inspector/protocol/Memory.json
1040     )
1041 endif ()
1042
1043 if (ENABLE_SERVICE_WORKER)
1044     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1045         ${JAVASCRIPTCORE_DIR}/inspector/protocol/ServiceWorker.json
1046     )
1047 endif ()
1048
1049 add_custom_command(
1050     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1051     MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-combined-inspector-json.py
1052     DEPENDS ${JavaScriptCore_INSPECTOR_DOMAINS}
1053     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-combined-inspector-json.py ${JavaScriptCore_INSPECTOR_DOMAINS} > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1054     VERBATIM)
1055
1056 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
1057 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol)
1058 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
1059 add_custom_command(
1060     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
1061            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1062            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.cpp
1063            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1064            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.cpp
1065            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1066            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
1067     MAIN_DEPENDENCY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1068     DEPENDS ${JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS}
1069     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
1070     VERBATIM)
1071
1072 # JSCBuiltins
1073
1074 set(BUILTINS_GENERATOR_SCRIPTS
1075     ${JavaScriptCore_SCRIPTS_DIR}/builtins.py
1076     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generator.py
1077     ${JavaScriptCore_SCRIPTS_DIR}/builtins_model.py
1078     ${JavaScriptCore_SCRIPTS_DIR}/builtins_templates.py
1079     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_combined_header.py
1080     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_combined_implementation.py
1081     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_header.py
1082     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_implementation.py
1083     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_wrapper_header.py
1084     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_wrapper_implementation.py
1085     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_internals_wrapper_header.py
1086     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_internals_wrapper_implementation.py
1087     ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
1088     ${JavaScriptCore_SCRIPTS_DIR}/lazywriter.py
1089 )
1090
1091 set(JavaScriptCore_BUILTINS_SOURCES
1092     ${JAVASCRIPTCORE_DIR}/builtins/AsyncFromSyncIteratorPrototype.js
1093     ${JAVASCRIPTCORE_DIR}/builtins/ArrayConstructor.js
1094     ${JAVASCRIPTCORE_DIR}/builtins/ArrayIteratorPrototype.js
1095     ${JAVASCRIPTCORE_DIR}/builtins/ArrayPrototype.js
1096     ${JAVASCRIPTCORE_DIR}/builtins/AsyncFunctionPrototype.js
1097     ${JAVASCRIPTCORE_DIR}/builtins/AsyncIteratorPrototype.js
1098     ${JAVASCRIPTCORE_DIR}/builtins/AsyncGeneratorPrototype.js
1099     ${JAVASCRIPTCORE_DIR}/builtins/DatePrototype.js
1100     ${JAVASCRIPTCORE_DIR}/builtins/FunctionPrototype.js
1101     ${JAVASCRIPTCORE_DIR}/builtins/GeneratorPrototype.js
1102     ${JAVASCRIPTCORE_DIR}/builtins/GlobalObject.js
1103     ${JAVASCRIPTCORE_DIR}/builtins/GlobalOperations.js
1104     ${JAVASCRIPTCORE_DIR}/builtins/InspectorInstrumentationObject.js
1105     ${JAVASCRIPTCORE_DIR}/builtins/InternalPromiseConstructor.js
1106     ${JAVASCRIPTCORE_DIR}/builtins/IteratorHelpers.js
1107     ${JAVASCRIPTCORE_DIR}/builtins/IteratorPrototype.js
1108     ${JAVASCRIPTCORE_DIR}/builtins/MapIteratorPrototype.js
1109     ${JAVASCRIPTCORE_DIR}/builtins/MapPrototype.js
1110     ${JAVASCRIPTCORE_DIR}/builtins/ModuleLoader.js
1111     ${JAVASCRIPTCORE_DIR}/builtins/NumberConstructor.js
1112     ${JAVASCRIPTCORE_DIR}/builtins/NumberPrototype.js
1113     ${JAVASCRIPTCORE_DIR}/builtins/ObjectConstructor.js
1114     ${JAVASCRIPTCORE_DIR}/builtins/PromiseConstructor.js
1115     ${JAVASCRIPTCORE_DIR}/builtins/PromiseOperations.js
1116     ${JAVASCRIPTCORE_DIR}/builtins/PromisePrototype.js
1117     ${JAVASCRIPTCORE_DIR}/builtins/ReflectObject.js
1118     ${JAVASCRIPTCORE_DIR}/builtins/RegExpPrototype.js
1119     ${JAVASCRIPTCORE_DIR}/builtins/SetIteratorPrototype.js
1120     ${JAVASCRIPTCORE_DIR}/builtins/SetPrototype.js
1121     ${JAVASCRIPTCORE_DIR}/builtins/StringConstructor.js
1122     ${JAVASCRIPTCORE_DIR}/builtins/StringIteratorPrototype.js
1123     ${JAVASCRIPTCORE_DIR}/builtins/StringPrototype.js
1124     ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayConstructor.js
1125     ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayPrototype.js
1126     ${JAVASCRIPTCORE_DIR}/builtins/WebAssemblyPrototype.js
1127 )
1128
1129 add_custom_command(
1130     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1131     MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
1132     DEPENDS ${JavaScriptCore_BUILTINS_SOURCES} ${BUILTINS_GENERATOR_SCRIPTS}
1133     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py --framework JavaScriptCore --output-directory ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} --combined ${JavaScriptCore_BUILTINS_SOURCES}
1134     VERBATIM)
1135
1136 list(APPEND JavaScriptCore_HEADERS
1137     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1138     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1139     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1140     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1141 )
1142
1143 add_custom_command(
1144     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcode.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcodeGenerated.h
1145     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/b3/air/AirOpcode.opcodes
1146     DEPENDS ${JAVASCRIPTCORE_DIR}/b3/air/opcode_generator.rb
1147     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/b3/air/opcode_generator.rb ${JAVASCRIPTCORE_DIR}/b3/air/AirOpcode.opcodes VERBATIM
1148     WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
1149 )
1150
1151 list(APPEND JavaScriptCore_HEADERS
1152     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcode.h
1153     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcodeGenerated.h
1154 )
1155
1156 add_custom_command(
1157     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1158     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js
1159     DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
1160     COMMAND ${CMAKE_COMMAND} -E echo "//# sourceURL=__InjectedScript_InjectedScriptSource.js" > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1161     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py < ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js >> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1162     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h
1163     VERBATIM)
1164
1165 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h)
1166
1167 if (WTF_CPU_X86_64)
1168     if (MSVC AND ENABLE_JIT)
1169         add_custom_command(
1170             OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
1171             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1172             COMMAND ml64 -nologo -c -Fo ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1173             VERBATIM)
1174
1175         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj)
1176     endif ()
1177 endif ()
1178
1179 WEBKIT_FRAMEWORK_DECLARE(JavaScriptCore)
1180 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
1181
1182 if (COMPILER_IS_GCC_OR_CLANG)
1183     # Avoid using fused multiply-add instructions since this could give different results
1184     # for e.g. parseInt depending on the platform and compilation flags.
1185     WEBKIT_ADD_TARGET_CXX_FLAGS(JavaScriptCore -ffp-contract=off)
1186 endif ()
1187
1188 WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
1189     FILES ${JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS}
1190     FLATTENED
1191 )
1192
1193 WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
1194     TARGET_NAME JavaScriptCorePrivateForwardingHeaders
1195     FILES ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS}
1196     DERIVED_SOURCE_DIRECTORIES ${DERIVED_SOURCES_DIR}/JavaScriptCore ${DERIVED_SOURCES_DIR}/JavaScriptCore/inspector
1197     FLATTENED
1198 )
1199
1200 target_include_directories(LLIntOffsetsExtractor PRIVATE
1201     ${JavaScriptCore_INCLUDE_DIRECTORIES}
1202     ${JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES}
1203 )
1204 target_include_directories(LLIntOffsetsExtractor SYSTEM PRIVATE ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
1205
1206 add_subdirectory(shell)
1207
1208 WEBKIT_COMPUTE_SOURCES(JavaScriptCore)
1209 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
1210 WEBKIT_FRAMEWORK(JavaScriptCore)
1211
1212 if (NOT "${PORT}" STREQUAL "Mac")
1213     if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
1214         WEBKIT_POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE)
1215         set_target_properties(JavaScriptCore PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR})
1216         install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}")
1217     endif ()
1218 endif ()
1219
1220 # Force staging of shared scripts, even if they aren't directly used to build JavaScriptCore.
1221
1222 add_custom_target(stageSharedScripts DEPENDS ${JavaScriptCore_SCRIPTS})
1223 add_dependencies(JavaScriptCore stageSharedScripts ${JavaScriptCore_EXTRA_DEPENDENCIES})
1224
1225 if (MSVC)
1226     add_custom_command(
1227         TARGET JavaScriptCore
1228         PRE_BUILD
1229         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/auto-version.pl ${DERIVED_SOURCES_DIR}
1230         VERBATIM)
1231
1232     add_custom_command(
1233         TARGET JavaScriptCore
1234         POST_BUILD
1235         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/version-stamp.pl ${DERIVED_SOURCES_DIR} $<TARGET_FILE:JavaScriptCore>
1236         VERBATIM)
1237 endif ()