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