[cmake] Include WTF, JSC, and WebCore headers automatically to targers using them
[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 set(JavaScriptCore_INCLUDE_DIRECTORIES
6     "${JAVASCRIPTCORE_DIR}"
7     "${JAVASCRIPTCORE_DIR}/.."
8     "${JAVASCRIPTCORE_DIR}/API"
9     "${JAVASCRIPTCORE_DIR}/ForwardingHeaders"
10     "${JAVASCRIPTCORE_DIR}/assembler"
11     "${JAVASCRIPTCORE_DIR}/b3"
12     "${JAVASCRIPTCORE_DIR}/b3/air"
13     "${JAVASCRIPTCORE_DIR}/bindings"
14     "${JAVASCRIPTCORE_DIR}/builtins"
15     "${JAVASCRIPTCORE_DIR}/bytecode"
16     "${JAVASCRIPTCORE_DIR}/bytecompiler"
17     "${JAVASCRIPTCORE_DIR}/dfg"
18     "${JAVASCRIPTCORE_DIR}/disassembler"
19     "${JAVASCRIPTCORE_DIR}/disassembler/udis86"
20     "${JAVASCRIPTCORE_DIR}/domjit"
21     "${JAVASCRIPTCORE_DIR}/ftl"
22     "${JAVASCRIPTCORE_DIR}/heap"
23     "${JAVASCRIPTCORE_DIR}/debugger"
24     "${JAVASCRIPTCORE_DIR}/inspector"
25     "${JAVASCRIPTCORE_DIR}/inspector/agents"
26     "${JAVASCRIPTCORE_DIR}/inspector/augmentable"
27     "${JAVASCRIPTCORE_DIR}/inspector/remote"
28     "${JAVASCRIPTCORE_DIR}/interpreter"
29     "${JAVASCRIPTCORE_DIR}/jit"
30     "${JAVASCRIPTCORE_DIR}/llint"
31     "${JAVASCRIPTCORE_DIR}/parser"
32     "${JAVASCRIPTCORE_DIR}/profiler"
33     "${JAVASCRIPTCORE_DIR}/replay"
34     "${JAVASCRIPTCORE_DIR}/runtime"
35     "${JAVASCRIPTCORE_DIR}/tools"
36     "${JAVASCRIPTCORE_DIR}/wasm"
37     "${JAVASCRIPTCORE_DIR}/wasm/js"
38     "${JAVASCRIPTCORE_DIR}/yarr"
39     "${DERIVED_SOURCES_DIR}/ForwardingHeaders"
40     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
41     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector"
42 )
43
44 set(JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES
45     "${ICU_INCLUDE_DIRS}"
46 )
47
48 set(JavaScriptCore_SOURCES
49     API/JSBase.cpp
50     API/JSCTestRunnerUtils.cpp
51     API/JSCallbackConstructor.cpp
52     API/JSCallbackFunction.cpp
53     API/JSCallbackObject.cpp
54     API/JSClassRef.cpp
55     API/JSContextRef.cpp
56     API/JSObjectRef.cpp
57     API/JSTypedArray.cpp
58     API/JSScriptRef.cpp
59     API/JSStringRef.cpp
60     API/JSValueRef.cpp
61     API/JSWeakObjectMapRefPrivate.cpp
62     API/OpaqueJSString.cpp
63
64     assembler/ARMAssembler.cpp
65     assembler/LinkBuffer.cpp
66     assembler/MacroAssembler.cpp
67     assembler/MacroAssemblerARM.cpp
68     assembler/MacroAssemblerARMv7.cpp
69     assembler/MacroAssemblerCodeRef.cpp
70     assembler/MacroAssemblerPrinter.cpp
71     assembler/MacroAssemblerX86Common.cpp
72
73     b3/air/AirAllocateStack.cpp
74     b3/air/AirArg.cpp
75     b3/air/AirBasicBlock.cpp
76     b3/air/AirCCallSpecial.cpp
77     b3/air/AirCCallingConvention.cpp
78     b3/air/AirCode.cpp
79     b3/air/AirCustom.cpp
80     b3/air/AirDumpAsJS.cpp
81     b3/air/AirEliminateDeadCode.cpp
82     b3/air/AirEmitShuffle.cpp
83     b3/air/AirFixObviousSpills.cpp
84     b3/air/AirFixPartialRegisterStalls.cpp
85     b3/air/AirGenerate.cpp
86     b3/air/AirGenerated.cpp
87     b3/air/AirHandleCalleeSaves.cpp
88     b3/air/AirInsertionSet.cpp
89     b3/air/AirInst.cpp
90     b3/air/AirIteratedRegisterCoalescing.cpp
91     b3/air/AirKind.cpp
92     b3/air/AirLogRegisterPressure.cpp
93     b3/air/AirLowerAfterRegAlloc.cpp
94     b3/air/AirLowerEntrySwitch.cpp
95     b3/air/AirLowerMacros.cpp
96     b3/air/AirOptimizeBlockOrder.cpp
97     b3/air/AirPadInterference.cpp
98     b3/air/AirPhaseScope.cpp
99     b3/air/AirReportUsedRegisters.cpp
100     b3/air/AirSimplifyCFG.cpp
101     b3/air/AirSpecial.cpp
102     b3/air/AirSpillEverything.cpp
103     b3/air/AirStackSlot.cpp
104     b3/air/AirStackSlotKind.cpp
105     b3/air/AirTmp.cpp
106     b3/air/AirTmpWidth.cpp
107     b3/air/AirValidate.cpp
108
109     b3/B3ArgumentRegValue.cpp
110     b3/B3BasicBlock.cpp
111     b3/B3BlockInsertionSet.cpp
112     b3/B3BreakCriticalEdges.cpp
113     b3/B3CCallValue.cpp
114     b3/B3CaseCollection.cpp
115     b3/B3CheckSpecial.cpp
116     b3/B3CheckValue.cpp
117     b3/B3Common.cpp
118     b3/B3Commutativity.cpp
119     b3/B3Compilation.cpp
120     b3/B3Const32Value.cpp
121     b3/B3Const64Value.cpp
122     b3/B3ConstDoubleValue.cpp
123     b3/B3ConstFloatValue.cpp
124     b3/B3ConstrainedValue.cpp
125     b3/B3DataSection.cpp
126     b3/B3DuplicateTails.cpp
127     b3/B3Effects.cpp
128     b3/B3EliminateCommonSubexpressions.cpp
129     b3/B3FenceValue.cpp
130     b3/B3FixSSA.cpp
131     b3/B3FoldPathConstants.cpp
132     b3/B3FrequencyClass.cpp
133     b3/B3Generate.cpp
134     b3/B3HeapRange.cpp
135     b3/B3InferSwitches.cpp
136     b3/B3InsertionSet.cpp
137     b3/B3Kind.cpp
138     b3/B3LegalizeMemoryOffsets.cpp
139     b3/B3LowerMacros.cpp
140     b3/B3LowerMacrosAfterOptimizations.cpp
141     b3/B3LowerToAir.cpp
142     b3/B3MathExtras.cpp
143     b3/B3MemoryValue.cpp
144     b3/B3MoveConstants.cpp
145     b3/B3OpaqueByproducts.cpp
146     b3/B3Opcode.cpp
147     b3/B3Origin.cpp
148     b3/B3OriginDump.cpp
149     b3/B3PatchpointSpecial.cpp
150     b3/B3PatchpointValue.cpp
151     b3/B3PhaseScope.cpp
152     b3/B3PhiChildren.cpp
153     b3/B3Procedure.cpp
154     b3/B3PureCSE.cpp
155     b3/B3ReduceDoubleToFloat.cpp
156     b3/B3ReduceStrength.cpp
157     b3/B3SSACalculator.cpp
158     b3/B3SlotBaseValue.cpp
159     b3/B3StackmapGenerationParams.cpp
160     b3/B3StackmapSpecial.cpp
161     b3/B3StackmapValue.cpp
162     b3/B3StackSlot.cpp
163     b3/B3SwitchCase.cpp
164     b3/B3SwitchValue.cpp
165     b3/B3TimingScope.cpp
166     b3/B3Type.cpp
167     b3/B3UpsilonValue.cpp
168     b3/B3UseCounts.cpp
169     b3/B3Validate.cpp
170     b3/B3Value.cpp
171     b3/B3ValueKey.cpp
172     b3/B3ValueRep.cpp
173     b3/B3Variable.cpp
174     b3/B3VariableValue.cpp
175     b3/B3WasmAddressValue.cpp
176     b3/B3WasmBoundsCheckValue.cpp
177
178     bindings/ScriptFunctionCall.cpp
179     bindings/ScriptObject.cpp
180     bindings/ScriptValue.cpp
181
182     builtins/BuiltinExecutables.cpp
183     builtins/BuiltinExecutableCreator.cpp
184
185     bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp
186     bytecode/ArithProfile.cpp
187     bytecode/ArrayAllocationProfile.cpp
188     bytecode/ArrayProfile.cpp
189     bytecode/BytecodeBasicBlock.cpp
190     bytecode/BytecodeGeneratorification.cpp
191     bytecode/BytecodeIntrinsicRegistry.cpp
192     bytecode/BytecodeLivenessAnalysis.cpp
193     bytecode/BytecodeRewriter.cpp
194     bytecode/CallEdge.cpp
195     bytecode/CallLinkInfo.cpp
196     bytecode/CallLinkStatus.cpp
197     bytecode/CallMode.cpp
198     bytecode/CallVariant.cpp
199     bytecode/CodeBlock.cpp
200     bytecode/CodeBlockHash.cpp
201     bytecode/CodeBlockJettisoningWatchpoint.cpp
202     bytecode/CodeOrigin.cpp
203     bytecode/CodeType.cpp
204     bytecode/ComplexGetStatus.cpp
205     bytecode/DFGExitProfile.cpp
206     bytecode/DOMJITAccessCasePatchpointParams.cpp
207     bytecode/DataFormat.cpp
208     bytecode/DeferredCompilationCallback.cpp
209     bytecode/DeferredSourceDump.cpp
210     bytecode/DirectEvalCodeCache.cpp
211     bytecode/EvalCodeBlock.cpp
212     bytecode/ExecutionCounter.cpp
213     bytecode/ExitKind.cpp
214     bytecode/ExitingJITType.cpp
215     bytecode/FunctionCodeBlock.cpp
216     bytecode/GetByIdStatus.cpp
217     bytecode/GetByIdVariant.cpp
218     bytecode/InlineAccess.cpp
219     bytecode/InlineCallFrame.cpp
220     bytecode/InlineCallFrameSet.cpp
221     bytecode/JumpTable.cpp
222     bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp
223     bytecode/LazyOperandValueProfile.cpp
224     bytecode/MethodOfGettingAValueProfile.cpp
225     bytecode/ModuleProgramCodeBlock.cpp
226     bytecode/ObjectPropertyCondition.cpp
227     bytecode/ObjectPropertyConditionSet.cpp
228     bytecode/Opcode.cpp
229     bytecode/PolymorphicAccess.cpp
230     bytecode/PreciseJumpTargets.cpp
231     bytecode/ProgramCodeBlock.cpp
232     bytecode/PropertyCondition.cpp
233     bytecode/PutByIdFlags.cpp
234     bytecode/PutByIdStatus.cpp
235     bytecode/PutByIdVariant.cpp
236     bytecode/ReduceWhitespace.cpp
237     bytecode/SpecialPointer.cpp
238     bytecode/SpeculatedType.cpp
239     bytecode/StructureSet.cpp
240     bytecode/StructureStubClearingWatchpoint.cpp
241     bytecode/StructureStubInfo.cpp
242     bytecode/SuperSampler.cpp
243     bytecode/ToThisStatus.cpp
244     bytecode/TrackedReferences.cpp
245     bytecode/UnlinkedCodeBlock.cpp
246     bytecode/UnlinkedEvalCodeBlock.cpp
247     bytecode/UnlinkedFunctionCodeBlock.cpp
248     bytecode/UnlinkedFunctionExecutable.cpp
249     bytecode/UnlinkedInstructionStream.cpp
250     bytecode/UnlinkedModuleProgramCodeBlock.cpp
251     bytecode/UnlinkedProgramCodeBlock.cpp
252     bytecode/ValueRecovery.cpp
253     bytecode/VariableWriteFireDetail.cpp
254     bytecode/VirtualRegister.cpp
255     bytecode/Watchpoint.cpp
256
257     bytecompiler/BytecodeGenerator.cpp
258     bytecompiler/NodesCodegen.cpp
259
260     debugger/Debugger.cpp
261     debugger/DebuggerCallFrame.cpp
262     debugger/DebuggerLocation.cpp
263     debugger/DebuggerParseData.cpp
264     debugger/DebuggerScope.cpp
265
266     dfg/DFGAbstractHeap.cpp
267     dfg/DFGAbstractValue.cpp
268     dfg/DFGAdaptiveInferredPropertyValueWatchpoint.cpp
269     dfg/DFGAdaptiveStructureWatchpoint.cpp
270     dfg/DFGArgumentsEliminationPhase.cpp
271     dfg/DFGArgumentsUtilities.cpp
272     dfg/DFGArithMode.cpp
273     dfg/DFGArrayMode.cpp
274     dfg/DFGAtTailAbstractState.cpp
275     dfg/DFGAvailability.cpp
276     dfg/DFGAvailabilityMap.cpp
277     dfg/DFGBackwardsPropagationPhase.cpp
278     dfg/DFGBasicBlock.cpp
279     dfg/DFGBlockInsertionSet.cpp
280     dfg/DFGBlockSet.cpp
281     dfg/DFGByteCodeParser.cpp
282     dfg/DFGCFAPhase.cpp
283     dfg/DFGCFGSimplificationPhase.cpp
284     dfg/DFGCPSRethreadingPhase.cpp
285     dfg/DFGCSEPhase.cpp
286     dfg/DFGCapabilities.cpp
287     dfg/DFGCleanUpPhase.cpp
288     dfg/DFGClobberSet.cpp
289     dfg/DFGClobberize.cpp
290     dfg/DFGClobbersExitState.cpp
291     dfg/DFGCombinedLiveness.cpp
292     dfg/DFGCommon.cpp
293     dfg/DFGCommonData.cpp
294     dfg/DFGCompilationKey.cpp
295     dfg/DFGCompilationMode.cpp
296     dfg/DFGConstantFoldingPhase.cpp
297     dfg/DFGConstantHoistingPhase.cpp
298     dfg/DFGCriticalEdgeBreakingPhase.cpp
299     dfg/DFGDCEPhase.cpp
300     dfg/DFGDOMJITPatchpointParams.cpp
301     dfg/DFGDesiredIdentifiers.cpp
302     dfg/DFGDesiredTransitions.cpp
303     dfg/DFGDesiredWatchpoints.cpp
304     dfg/DFGDesiredWeakReferences.cpp
305     dfg/DFGDisassembler.cpp
306     dfg/DFGDoesGC.cpp
307     dfg/DFGDriver.cpp
308     dfg/DFGEdge.cpp
309     dfg/DFGEpoch.cpp
310     dfg/DFGFailedFinalizer.cpp
311     dfg/DFGFinalizer.cpp
312     dfg/DFGFixupPhase.cpp
313     dfg/DFGFlowIndexing.cpp
314     dfg/DFGFlushFormat.cpp
315     dfg/DFGFlushedAt.cpp
316     dfg/DFGLiveCatchVariablePreservationPhase.cpp
317     dfg/DFGFrozenValue.cpp
318     dfg/DFGGraph.cpp
319     dfg/DFGGraphSafepoint.cpp
320     dfg/DFGHeapLocation.cpp
321     dfg/DFGInPlaceAbstractState.cpp
322     dfg/DFGInferredTypeCheck.cpp
323     dfg/DFGInsertionSet.cpp
324     dfg/DFGIntegerCheckCombiningPhase.cpp
325     dfg/DFGIntegerRangeOptimizationPhase.cpp
326     dfg/DFGInvalidationPointInjectionPhase.cpp
327     dfg/DFGJITCode.cpp
328     dfg/DFGJITCompiler.cpp
329     dfg/DFGJITFinalizer.cpp
330     dfg/DFGJumpReplacement.cpp
331     dfg/DFGLICMPhase.cpp
332     dfg/DFGLazyJSValue.cpp
333     dfg/DFGLazyNode.cpp
334     dfg/DFGLivenessAnalysisPhase.cpp
335     dfg/DFGLongLivedState.cpp
336     dfg/DFGLoopPreHeaderCreationPhase.cpp
337     dfg/DFGMaximalFlushInsertionPhase.cpp
338     dfg/DFGMayExit.cpp
339     dfg/DFGMinifiedGraph.cpp
340     dfg/DFGMinifiedNode.cpp
341     dfg/DFGMovHintRemovalPhase.cpp
342     dfg/DFGMultiGetByOffsetData.cpp
343     dfg/DFGNaturalLoops.cpp
344     dfg/DFGNode.cpp
345     dfg/DFGNodeAbstractValuePair.cpp
346     dfg/DFGNodeFlags.cpp
347     dfg/DFGNodeFlowProjection.cpp
348     dfg/DFGNodeOrigin.cpp
349     dfg/DFGOSRAvailabilityAnalysisPhase.cpp
350     dfg/DFGOSREntry.cpp
351     dfg/DFGOSREntrypointCreationPhase.cpp
352     dfg/DFGOSRExit.cpp
353     dfg/DFGOSRExitBase.cpp
354     dfg/DFGOSRExitCompiler.cpp
355     dfg/DFGOSRExitCompiler32_64.cpp
356     dfg/DFGOSRExitCompiler64.cpp
357     dfg/DFGOSRExitCompilerCommon.cpp
358     dfg/DFGOSRExitFuzz.cpp
359     dfg/DFGOSRExitJumpPlaceholder.cpp
360     dfg/DFGOSRExitPreparation.cpp
361     dfg/DFGObjectAllocationSinkingPhase.cpp
362     dfg/DFGObjectMaterializationData.cpp
363     dfg/DFGOperations.cpp
364     dfg/DFGPhantomInsertionPhase.cpp
365     dfg/DFGPhase.cpp
366     dfg/DFGPhiChildren.cpp
367     dfg/DFGPlan.cpp
368     dfg/DFGPrePostNumbering.cpp
369     dfg/DFGPredictionInjectionPhase.cpp
370     dfg/DFGPredictionPropagationPhase.cpp
371     dfg/DFGPromotedHeapLocation.cpp
372     dfg/DFGPureValue.cpp
373     dfg/DFGPutStackSinkingPhase.cpp
374     dfg/DFGSSACalculator.cpp
375     dfg/DFGSSAConversionPhase.cpp
376     dfg/DFGSSALoweringPhase.cpp
377     dfg/DFGSafepoint.cpp
378     dfg/DFGSpeculativeJIT.cpp
379     dfg/DFGSpeculativeJIT32_64.cpp
380     dfg/DFGSpeculativeJIT64.cpp
381     dfg/DFGStackLayoutPhase.cpp
382     dfg/DFGStaticExecutionCountEstimationPhase.cpp
383     dfg/DFGStoreBarrierClusteringPhase.cpp
384     dfg/DFGStoreBarrierInsertionPhase.cpp
385     dfg/DFGStrengthReductionPhase.cpp
386     dfg/DFGStructureAbstractValue.cpp
387     dfg/DFGStructureRegistrationPhase.cpp
388     dfg/DFGThreadData.cpp
389     dfg/DFGThunks.cpp
390     dfg/DFGTierUpCheckInjectionPhase.cpp
391     dfg/DFGToFTLDeferredCompilationCallback.cpp
392     dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp
393     dfg/DFGTransition.cpp
394     dfg/DFGTypeCheckHoistingPhase.cpp
395     dfg/DFGUnificationPhase.cpp
396     dfg/DFGUseKind.cpp
397     dfg/DFGValidate.cpp
398     dfg/DFGValueSource.cpp
399     dfg/DFGValueStrength.cpp
400     dfg/DFGVarargsForwardingPhase.cpp
401     dfg/DFGVariableAccessData.cpp
402     dfg/DFGVariableAccessDataDump.cpp
403     dfg/DFGVariableEvent.cpp
404     dfg/DFGVariableEventStream.cpp
405     dfg/DFGVirtualRegisterAllocationPhase.cpp
406     dfg/DFGWatchpointCollectionPhase.cpp
407     dfg/DFGWorklist.cpp
408
409     disassembler/ARM64Disassembler.cpp
410     disassembler/ARMLLVMDisassembler.cpp
411     disassembler/ARMv7Disassembler.cpp
412     disassembler/Disassembler.cpp
413     disassembler/UDis86Disassembler.cpp
414     disassembler/X86Disassembler.cpp
415
416     disassembler/ARM64/A64DOpcode.cpp
417
418     disassembler/ARMv7/ARMv7DOpcode.cpp
419
420     disassembler/udis86/udis86.c
421     disassembler/udis86/udis86_decode.c
422     disassembler/udis86/udis86_itab_holder.c
423     disassembler/udis86/udis86_syn-att.c
424     disassembler/udis86/udis86_syn-intel.c
425     disassembler/udis86/udis86_syn.c
426
427     domjit/DOMJITAbstractHeap.cpp
428     domjit/DOMJITHeapRange.cpp
429
430     ftl/FTLAbstractHeap.cpp
431     ftl/FTLAbstractHeapRepository.cpp
432     ftl/FTLAvailableRecovery.cpp
433     ftl/FTLCapabilities.cpp
434     ftl/FTLCommonValues.cpp
435     ftl/FTLCompile.cpp
436     ftl/FTLDOMJITPatchpointParams.cpp
437     ftl/FTLExceptionTarget.cpp
438     ftl/FTLExitArgument.cpp
439     ftl/FTLExitArgumentForOperand.cpp
440     ftl/FTLExitPropertyValue.cpp
441     ftl/FTLExitTimeObjectMaterialization.cpp
442     ftl/FTLExitValue.cpp
443     ftl/FTLFail.cpp
444     ftl/FTLForOSREntryJITCode.cpp
445     ftl/FTLJITCode.cpp
446     ftl/FTLJITFinalizer.cpp
447     ftl/FTLLazySlowPath.cpp
448     ftl/FTLLink.cpp
449     ftl/FTLLocation.cpp
450     ftl/FTLLowerDFGToB3.cpp
451     ftl/FTLOSREntry.cpp
452     ftl/FTLOSRExit.cpp
453     ftl/FTLOSRExitCompiler.cpp
454     ftl/FTLOSRExitHandle.cpp
455     ftl/FTLOperations.cpp
456     ftl/FTLOutput.cpp
457     ftl/FTLPatchpointExceptionHandle.cpp
458     ftl/FTLRecoveryOpcode.cpp
459     ftl/FTLSaveRestore.cpp
460     ftl/FTLSlowPathCall.cpp
461     ftl/FTLSlowPathCallKey.cpp
462     ftl/FTLState.cpp
463     ftl/FTLThunks.cpp
464     ftl/FTLValueRange.cpp
465
466     heap/AllocatorAttributes.cpp
467     heap/CodeBlockSet.cpp
468     heap/CollectionScope.cpp
469     heap/ConservativeRoots.cpp
470     heap/DeferGC.cpp
471     heap/DestructionMode.cpp
472     heap/EdenGCActivityCallback.cpp
473     heap/FullGCActivityCallback.cpp
474     heap/FreeList.cpp
475     heap/GCActivityCallback.cpp
476     heap/GCLogging.cpp
477     heap/HandleSet.cpp
478     heap/HandleStack.cpp
479     heap/Heap.cpp
480     heap/HeapCell.cpp
481     heap/HeapHelperPool.cpp
482     heap/HeapProfiler.cpp
483     heap/HeapSnapshot.cpp
484     heap/HeapSnapshotBuilder.cpp
485     heap/HeapStatistics.cpp
486     heap/HeapTimer.cpp
487     heap/HeapVerifier.cpp
488     heap/IncrementalSweeper.cpp
489     heap/JITStubRoutineSet.cpp
490     heap/LargeAllocation.cpp
491     heap/LiveObjectList.cpp
492     heap/MachineStackMarker.cpp
493     heap/MarkStack.cpp
494     heap/MarkedAllocator.cpp
495     heap/MarkedBlock.cpp
496     heap/MarkedSpace.cpp
497     heap/MutatorState.cpp
498     heap/SlotVisitor.cpp
499     heap/StopIfNecessaryTimer.cpp
500     heap/VisitRaceKey.cpp
501     heap/Weak.cpp
502     heap/WeakBlock.cpp
503     heap/WeakHandleOwner.cpp
504     heap/WeakSet.cpp
505     heap/WriteBarrierBuffer.cpp
506     heap/WriteBarrierSupport.cpp
507
508     inspector/ConsoleMessage.cpp
509     inspector/ContentSearchUtilities.cpp
510     inspector/EventLoop.cpp
511     inspector/IdentifiersFactory.cpp
512     inspector/InjectedScript.cpp
513     inspector/InjectedScriptBase.cpp
514     inspector/InjectedScriptHost.cpp
515     inspector/InjectedScriptManager.cpp
516     inspector/InjectedScriptModule.cpp
517     inspector/InspectorAgentRegistry.cpp
518     inspector/InspectorFrontendRouter.cpp
519     inspector/InspectorBackendDispatcher.cpp
520     inspector/InspectorValues.cpp
521     inspector/JSGlobalObjectConsoleClient.cpp
522     inspector/JSGlobalObjectInspectorController.cpp
523     inspector/JSGlobalObjectScriptDebugServer.cpp
524     inspector/JSInjectedScriptHost.cpp
525     inspector/JSInjectedScriptHostPrototype.cpp
526     inspector/JSJavaScriptCallFrame.cpp
527     inspector/JSJavaScriptCallFramePrototype.cpp
528     inspector/JavaScriptCallFrame.cpp
529     inspector/PerGlobalObjectWrapperWorld.cpp
530     inspector/ScriptArguments.cpp
531     inspector/ScriptCallFrame.cpp
532     inspector/ScriptCallStack.cpp
533     inspector/ScriptCallStackFactory.cpp
534     inspector/ScriptDebugServer.cpp
535
536     inspector/agents/InspectorAgent.cpp
537     inspector/agents/InspectorConsoleAgent.cpp
538     inspector/agents/InspectorDebuggerAgent.cpp
539     inspector/agents/InspectorHeapAgent.cpp
540     inspector/agents/InspectorRuntimeAgent.cpp
541     inspector/agents/InspectorScriptProfilerAgent.cpp
542     inspector/agents/JSGlobalObjectConsoleAgent.cpp
543     inspector/agents/JSGlobalObjectDebuggerAgent.cpp
544     inspector/agents/JSGlobalObjectRuntimeAgent.cpp
545
546     interpreter/AbstractPC.cpp
547     interpreter/CLoopStack.cpp
548     interpreter/CallFrame.cpp
549     interpreter/Interpreter.cpp
550     interpreter/ProtoCallFrame.cpp
551     interpreter/ShadowChicken.cpp
552     interpreter/StackVisitor.cpp
553
554     jit/AssemblyHelpers.cpp
555     jit/BinarySwitch.cpp
556     jit/CCallHelpers.cpp
557     jit/CachedRecovery.cpp
558     jit/CallFrameShuffleData.cpp
559     jit/CallFrameShuffler.cpp
560     jit/CallFrameShuffler32_64.cpp
561     jit/CallFrameShuffler64.cpp
562     jit/ExecutableAllocationFuzz.cpp
563     jit/ExecutableAllocator.cpp
564     jit/ExecutableAllocatorFixedVMPool.cpp
565     jit/GCAwareJITStubRoutine.cpp
566     jit/GPRInfo.cpp
567     jit/HostCallReturnValue.cpp
568     jit/ICStats.cpp
569     jit/IntrinsicEmitter.cpp
570     jit/JIT.cpp
571     jit/JITAddGenerator.cpp
572     jit/JITArithmetic.cpp
573     jit/JITArithmetic32_64.cpp
574     jit/JITBitAndGenerator.cpp
575     jit/JITBitOrGenerator.cpp
576     jit/JITBitXorGenerator.cpp
577     jit/JITCall.cpp
578     jit/JITCall32_64.cpp
579     jit/JITCode.cpp
580     jit/JITDisassembler.cpp
581     jit/JITDivGenerator.cpp
582     jit/JITExceptions.cpp
583     jit/JITInlineCacheGenerator.cpp
584     jit/JITLeftShiftGenerator.cpp
585     jit/JITMulGenerator.cpp
586     jit/JITNegGenerator.cpp
587     jit/JITOpcodes.cpp
588     jit/JITOpcodes32_64.cpp
589     jit/JITOperations.cpp
590     jit/JITPropertyAccess.cpp
591     jit/JITPropertyAccess32_64.cpp
592     jit/JITRightShiftGenerator.cpp
593     jit/JITStubRoutine.cpp
594     jit/JITSubGenerator.cpp
595     jit/JITThunks.cpp
596     jit/JITToDFGDeferredCompilationCallback.cpp
597     jit/JITWorklist.cpp
598     jit/PCToCodeOriginMap.cpp
599     jit/PolymorphicCallStubRoutine.cpp
600     jit/Reg.cpp
601     jit/RegisterAtOffset.cpp
602     jit/RegisterAtOffsetList.cpp
603     jit/RegisterSet.cpp
604     jit/Repatch.cpp
605     jit/ScratchRegisterAllocator.cpp
606     jit/SetupVarargsFrame.cpp
607     jit/TagRegistersMode.cpp
608     jit/TempRegisterSet.cpp
609     jit/ThunkGenerators.cpp
610
611     llint/LLIntCLoop.cpp
612     llint/LLIntData.cpp
613     llint/LLIntEntrypoint.cpp
614     llint/LLIntExceptions.cpp
615     llint/LLIntSlowPaths.cpp
616     llint/LLIntThunks.cpp
617     llint/LowLevelInterpreter.cpp
618
619     parser/Lexer.cpp
620     parser/ModuleAnalyzer.cpp
621     parser/Nodes.cpp
622     parser/NodesAnalyzeModule.cpp
623     parser/Parser.cpp
624     parser/ParserArena.cpp
625     parser/SourceProvider.cpp
626     parser/SourceProviderCache.cpp
627     parser/UnlinkedSourceCode.cpp
628     parser/VariableEnvironment.cpp
629
630     profiler/ProfilerBytecode.cpp
631     profiler/ProfilerBytecodeSequence.cpp
632     profiler/ProfilerBytecodes.cpp
633     profiler/ProfilerCompilation.cpp
634     profiler/ProfilerCompilationKind.cpp
635     profiler/ProfilerCompiledBytecode.cpp
636     profiler/ProfilerDatabase.cpp
637     profiler/ProfilerEvent.cpp
638     profiler/ProfilerJettisonReason.cpp
639     profiler/ProfilerOSRExit.cpp
640     profiler/ProfilerOSRExitSite.cpp
641     profiler/ProfilerOrigin.cpp
642     profiler/ProfilerOriginStack.cpp
643     profiler/ProfilerProfiledBytecodes.cpp
644     profiler/ProfilerUID.cpp
645
646     runtime/AbstractModuleRecord.cpp
647     runtime/ArgList.cpp
648     runtime/ArrayBuffer.cpp
649     runtime/ArrayBufferNeuteringWatchpoint.cpp
650     runtime/ArrayBufferView.cpp
651     runtime/ArrayConstructor.cpp
652     runtime/ArrayConventions.cpp
653     runtime/ArrayIteratorAdaptiveWatchpoint.cpp
654     runtime/ArrayIteratorPrototype.cpp
655     runtime/ArrayPrototype.cpp
656     runtime/AtomicsObject.cpp
657     runtime/AsyncFunctionConstructor.cpp
658     runtime/AsyncFunctionPrototype.cpp
659     runtime/BasicBlockLocation.cpp
660     runtime/BooleanConstructor.cpp
661     runtime/BooleanObject.cpp
662     runtime/BooleanPrototype.cpp
663     runtime/CallData.cpp
664     runtime/CatchScope.cpp
665     runtime/ClonedArguments.cpp
666     runtime/CodeCache.cpp
667     runtime/CodeSpecializationKind.cpp
668     runtime/CommonIdentifiers.cpp
669     runtime/CommonSlowPaths.cpp
670     runtime/CommonSlowPathsExceptions.cpp
671     runtime/CompilationResult.cpp
672     runtime/Completion.cpp
673     runtime/ConsoleClient.cpp
674     runtime/ConsoleObject.cpp
675     runtime/ConstantMode.cpp
676     runtime/ConstructData.cpp
677     runtime/ControlFlowProfiler.cpp
678     runtime/CustomGetterSetter.cpp
679     runtime/DataView.cpp
680     runtime/DateConstructor.cpp
681     runtime/DateConversion.cpp
682     runtime/DateInstance.cpp
683     runtime/DatePrototype.cpp
684     runtime/DirectArguments.cpp
685     runtime/DirectArgumentsOffset.cpp
686     runtime/DirectEvalExecutable.cpp
687     runtime/DumpContext.cpp
688     runtime/ECMAScriptSpecInternalFunctions.cpp
689     runtime/Error.cpp
690     runtime/ErrorConstructor.cpp
691     runtime/ErrorHandlingScope.cpp
692     runtime/ErrorInstance.cpp
693     runtime/ErrorPrototype.cpp
694     runtime/EvalExecutable.cpp
695     runtime/Exception.cpp
696     runtime/ExceptionEventLocation.cpp
697     runtime/ExceptionFuzz.cpp
698     runtime/ExceptionHelpers.cpp
699     runtime/ExceptionScope.cpp
700     runtime/ExecutableBase.cpp
701     runtime/FunctionConstructor.cpp
702     runtime/FunctionExecutable.cpp
703     runtime/FunctionExecutableDump.cpp
704     runtime/FunctionHasExecutedCache.cpp
705     runtime/FunctionPrototype.cpp
706     runtime/FunctionRareData.cpp
707     runtime/GeneratorFunctionConstructor.cpp
708     runtime/GeneratorFunctionPrototype.cpp
709     runtime/GeneratorPrototype.cpp
710     runtime/GetterSetter.cpp
711     runtime/HashMapImpl.cpp
712     runtime/Identifier.cpp
713     runtime/IndexingType.cpp
714     runtime/IndirectEvalExecutable.cpp
715     runtime/InferredType.cpp
716     runtime/InferredTypeTable.cpp
717     runtime/InferredValue.cpp
718     runtime/InitializeThreading.cpp
719     runtime/InspectorInstrumentationObject.cpp
720     runtime/InternalFunction.cpp
721     runtime/IntlCollator.cpp
722     runtime/IntlCollatorConstructor.cpp
723     runtime/IntlCollatorPrototype.cpp
724     runtime/IntlDateTimeFormat.cpp
725     runtime/IntlDateTimeFormatConstructor.cpp
726     runtime/IntlDateTimeFormatPrototype.cpp
727     runtime/IntlNumberFormat.cpp
728     runtime/IntlNumberFormatConstructor.cpp
729     runtime/IntlNumberFormatPrototype.cpp
730     runtime/IntlObject.cpp
731     runtime/IteratorOperations.cpp
732     runtime/IteratorPrototype.cpp
733     runtime/JSAPIValueWrapper.cpp
734     runtime/JSArray.cpp
735     runtime/JSArrayBuffer.cpp
736     runtime/JSArrayBufferConstructor.cpp
737     runtime/JSArrayBufferPrototype.cpp
738     runtime/JSArrayBufferView.cpp
739     runtime/JSAsyncFunction.cpp
740     runtime/JSBoundFunction.cpp
741     runtime/JSCJSValue.cpp
742     runtime/JSCallee.cpp
743     runtime/JSCell.cpp
744     runtime/JSCustomGetterSetterFunction.cpp
745     runtime/JSDataView.cpp
746     runtime/JSDataViewPrototype.cpp
747     runtime/JSDateMath.cpp
748     runtime/JSEnvironmentRecord.cpp
749     runtime/JSFixedArray.cpp
750     runtime/JSFunction.cpp
751     runtime/JSGeneratorFunction.cpp
752     runtime/JSGlobalLexicalEnvironment.cpp
753     runtime/JSGlobalObject.cpp
754     runtime/JSGlobalObjectDebuggable.cpp
755     runtime/JSGlobalObjectFunctions.cpp
756     runtime/JSInternalPromise.cpp
757     runtime/JSInternalPromiseConstructor.cpp
758     runtime/JSInternalPromiseDeferred.cpp
759     runtime/JSInternalPromisePrototype.cpp
760     runtime/JSJob.cpp
761     runtime/JSLexicalEnvironment.cpp
762     runtime/JSLock.cpp
763     runtime/JSMap.cpp
764     runtime/JSMapIterator.cpp
765     runtime/JSModuleEnvironment.cpp
766     runtime/JSModuleLoader.cpp
767     runtime/JSModuleNamespaceObject.cpp
768     runtime/JSModuleRecord.cpp
769     runtime/JSNativeStdFunction.cpp
770     runtime/JSONObject.cpp
771     runtime/JSObject.cpp
772     runtime/JSPromise.cpp
773     runtime/JSPromiseConstructor.cpp
774     runtime/JSPromiseDeferred.cpp
775     runtime/JSPromisePrototype.cpp
776     runtime/JSPropertyNameEnumerator.cpp
777     runtime/JSPropertyNameIterator.cpp
778     runtime/JSProxy.cpp
779     runtime/JSScope.cpp
780     runtime/JSSegmentedVariableObject.cpp
781     runtime/JSSet.cpp
782     runtime/JSSetIterator.cpp
783     runtime/JSString.cpp
784     runtime/JSStringIterator.cpp
785     runtime/JSStringJoiner.cpp
786     runtime/JSSymbolTableObject.cpp
787     runtime/JSTemplateRegistryKey.cpp
788     runtime/JSTypedArrayConstructors.cpp
789     runtime/JSTypedArrayPrototypes.cpp
790     runtime/JSTypedArrayViewConstructor.cpp
791     runtime/JSTypedArrayViewPrototype.cpp
792     runtime/JSTypedArrays.cpp
793     runtime/JSWeakMap.cpp
794     runtime/JSWeakSet.cpp
795     runtime/JSWithScope.cpp
796     runtime/JSWrapperObject.cpp
797     runtime/LazyClassStructure.cpp
798     runtime/LiteralParser.cpp
799     runtime/Lookup.cpp
800     runtime/MapBase.cpp
801     runtime/MapConstructor.cpp
802     runtime/MapIteratorPrototype.cpp
803     runtime/MapPrototype.cpp
804     runtime/MatchResult.cpp
805     runtime/MathCommon.cpp
806     runtime/MathObject.cpp
807     runtime/MemoryStatistics.cpp
808     runtime/ModuleLoaderPrototype.cpp
809     runtime/ModuleProgramExecutable.cpp
810     runtime/NativeErrorConstructor.cpp
811     runtime/NativeErrorPrototype.cpp
812     runtime/NativeExecutable.cpp
813     runtime/NativeStdFunctionCell.cpp
814     runtime/NullGetterFunction.cpp
815     runtime/NullSetterFunction.cpp
816     runtime/NumberConstructor.cpp
817     runtime/NumberObject.cpp
818     runtime/NumberPrototype.cpp
819     runtime/ObjectConstructor.cpp
820     runtime/ObjectPrototype.cpp
821     runtime/Operations.cpp
822     runtime/Options.cpp
823     runtime/ProgramExecutable.cpp
824     runtime/PropertyDescriptor.cpp
825     runtime/PropertySlot.cpp
826     runtime/PropertyTable.cpp
827     runtime/PrototypeMap.cpp
828     runtime/ProxyConstructor.cpp
829     runtime/ProxyObject.cpp
830     runtime/ProxyRevoke.cpp
831     runtime/ReflectObject.cpp
832     runtime/RegExp.cpp
833     runtime/RegExpCache.cpp
834     runtime/RegExpCachedResult.cpp
835     runtime/RegExpConstructor.cpp
836     runtime/RegExpMatchesArray.cpp
837     runtime/RegExpObject.cpp
838     runtime/RegExpPrototype.cpp
839     runtime/RuntimeType.cpp
840     runtime/SamplingCounter.cpp
841     runtime/SamplingProfiler.cpp
842     runtime/ScopeOffset.cpp
843     runtime/ScopedArguments.cpp
844     runtime/ScopedArgumentsTable.cpp
845     runtime/ScriptExecutable.cpp
846     runtime/SetConstructor.cpp
847     runtime/SetIteratorPrototype.cpp
848     runtime/SetPrototype.cpp
849     runtime/SimpleTypedArrayController.cpp
850     runtime/SmallStrings.cpp
851     runtime/SparseArrayValueMap.cpp
852     runtime/StackFrame.cpp
853     runtime/StrictEvalActivation.cpp
854     runtime/StringConstructor.cpp
855     runtime/StringIteratorPrototype.cpp
856     runtime/StringObject.cpp
857     runtime/StringPrototype.cpp
858     runtime/StringRecursionChecker.cpp
859     runtime/Structure.cpp
860     runtime/StructureChain.cpp
861     runtime/StructureIDTable.cpp
862     runtime/StructureRareData.cpp
863     runtime/Symbol.cpp
864     runtime/SymbolConstructor.cpp
865     runtime/SymbolObject.cpp
866     runtime/SymbolPrototype.cpp
867     runtime/SymbolTable.cpp
868     runtime/TemplateRegistry.cpp
869     runtime/TemplateRegistryKey.cpp
870     runtime/TemplateRegistryKeyTable.cpp
871     runtime/TestRunnerUtils.cpp
872     runtime/ThrowScope.cpp
873     runtime/TypeLocationCache.cpp
874     runtime/TypeProfiler.cpp
875     runtime/TypeProfilerLog.cpp
876     runtime/TypeSet.cpp
877     runtime/TypedArrayController.cpp
878     runtime/TypedArrayType.cpp
879     runtime/TypeofType.cpp
880     runtime/VM.cpp
881     runtime/VMEntryScope.cpp
882     runtime/VarOffset.cpp
883     runtime/Watchdog.cpp
884     runtime/WeakMapConstructor.cpp
885     runtime/WeakMapData.cpp
886     runtime/WeakMapPrototype.cpp
887     runtime/WeakSetConstructor.cpp
888     runtime/WeakSetPrototype.cpp
889
890     tools/CodeProfile.cpp
891     tools/CodeProfiling.cpp
892     tools/FunctionOverrides.cpp
893     tools/FunctionWhitelist.cpp
894     tools/JSDollarVM.cpp
895     tools/JSDollarVMPrototype.cpp
896
897     wasm/JSWebAssembly.cpp
898     wasm/WasmB3IRGenerator.cpp
899     wasm/WasmBinding.cpp
900     wasm/WasmCallingConvention.cpp
901     wasm/WasmFormat.cpp
902     wasm/WasmMemory.cpp
903     wasm/WasmMemoryInformation.cpp
904     wasm/WasmModuleParser.cpp
905     wasm/WasmPlan.cpp
906     wasm/WasmValidate.cpp
907
908     wasm/js/JSWebAssemblyCallee.cpp
909     wasm/js/JSWebAssemblyCompileError.cpp
910     wasm/js/JSWebAssemblyInstance.cpp
911     wasm/js/JSWebAssemblyMemory.cpp
912     wasm/js/JSWebAssemblyModule.cpp
913     wasm/js/JSWebAssemblyRuntimeError.cpp
914     wasm/js/JSWebAssemblyTable.cpp
915     wasm/js/WebAssemblyCompileErrorConstructor.cpp
916     wasm/js/WebAssemblyCompileErrorPrototype.cpp
917     wasm/js/WebAssemblyFunction.cpp
918     wasm/js/WebAssemblyInstanceConstructor.cpp
919     wasm/js/WebAssemblyInstancePrototype.cpp
920     wasm/js/WebAssemblyMemoryConstructor.cpp
921     wasm/js/WebAssemblyMemoryPrototype.cpp
922     wasm/js/WebAssemblyModuleConstructor.cpp
923     wasm/js/WebAssemblyModulePrototype.cpp
924     wasm/js/WebAssemblyModuleRecord.cpp
925     wasm/js/WebAssemblyPrototype.cpp
926     wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
927     wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
928     wasm/js/WebAssemblyTableConstructor.cpp
929     wasm/js/WebAssemblyTablePrototype.cpp
930     wasm/js/WebAssemblyToJSCallee.cpp
931
932     yarr/RegularExpression.cpp
933     yarr/YarrCanonicalizeUCS2.cpp
934     yarr/YarrInterpreter.cpp
935     yarr/YarrJIT.cpp
936     yarr/YarrPattern.cpp
937     yarr/YarrSyntaxChecker.cpp
938 )
939
940 # Extra flags for compile sources can go here.
941 if (NOT MSVC)
942     set_source_files_properties(runtime/ProxyObject.cpp PROPERTIES COMPILE_FLAGS -fno-optimize-sibling-calls)
943 else ()
944     # FIXME: Investigate if we need to set a similar flag on Windows.
945 endif ()
946
947 set(JavaScriptCore_OBJECT_LUT_SOURCES
948     runtime/ArrayConstructor.cpp
949     runtime/ArrayIteratorPrototype.cpp
950     runtime/BooleanPrototype.cpp
951     runtime/DateConstructor.cpp
952     runtime/DatePrototype.cpp
953     runtime/ErrorPrototype.cpp
954     runtime/GeneratorPrototype.cpp
955     runtime/InspectorInstrumentationObject.cpp
956     runtime/IntlCollatorConstructor.cpp
957     runtime/IntlCollatorPrototype.cpp
958     runtime/IntlDateTimeFormatConstructor.cpp
959     runtime/IntlDateTimeFormatPrototype.cpp
960     runtime/IntlNumberFormatConstructor.cpp
961     runtime/IntlNumberFormatPrototype.cpp
962     runtime/JSDataViewPrototype.cpp
963     runtime/JSGlobalObject.cpp
964     runtime/JSInternalPromiseConstructor.cpp
965     runtime/JSONObject.cpp
966     runtime/JSPromiseConstructor.cpp
967     runtime/JSPromisePrototype.cpp
968     runtime/MapPrototype.cpp
969     runtime/ModuleLoaderPrototype.cpp
970     runtime/NumberConstructor.cpp
971     runtime/NumberPrototype.cpp
972     runtime/ObjectConstructor.cpp
973     runtime/ReflectObject.cpp
974     runtime/RegExpConstructor.cpp
975     runtime/RegExpPrototype.cpp
976     runtime/SetPrototype.cpp
977     runtime/StringConstructor.cpp
978     runtime/StringIteratorPrototype.cpp
979     runtime/StringPrototype.cpp
980     runtime/SymbolConstructor.cpp
981     runtime/SymbolPrototype.cpp
982
983     wasm/js/WebAssemblyCompileErrorConstructor.cpp
984     wasm/js/WebAssemblyCompileErrorPrototype.cpp
985     wasm/js/WebAssemblyInstanceConstructor.cpp
986     wasm/js/WebAssemblyInstancePrototype.cpp
987     wasm/js/WebAssemblyMemoryConstructor.cpp
988     wasm/js/WebAssemblyMemoryPrototype.cpp
989     wasm/js/WebAssemblyModuleConstructor.cpp
990     wasm/js/WebAssemblyModulePrototype.cpp
991     wasm/js/WebAssemblyPrototype.cpp
992     wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
993     wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
994     wasm/js/WebAssemblyTableConstructor.cpp
995     wasm/js/WebAssemblyTablePrototype.cpp
996 )
997
998 set(JavaScriptCore_LIBRARIES
999     WTF${DEBUG_SUFFIX}
1000     ${ICU_I18N_LIBRARIES}
1001     ${LLVM_LIBRARIES}
1002 )
1003
1004 set(JavaScriptCore_SCRIPTS_SOURCES_DIR "${JAVASCRIPTCORE_DIR}/Scripts")
1005
1006 # Globbing relies on the fact that generator-specific file names are prefixed with their directory.
1007 # Top-level scripts should have a file extension, since they are invoked during the build.
1008
1009 set(JavaScriptCore_SCRIPTS_SOURCES_PATHS
1010     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/*.pl
1011     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/*.py
1012     ${JavaScriptCore_SCRIPTS_SOURCES_DIR}/builtins/builtins*.py
1013 )
1014
1015 # Force JavaScriptCore to run scripts from the same staging path as WebCore.
1016 set(JavaScriptCore_SCRIPTS_DIR "${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/Scripts")
1017
1018 file(MAKE_DIRECTORY ${JavaScriptCore_SCRIPTS_DIR})
1019
1020 # The directory flattening performed below mirrors what the Mac port does with private headers.
1021
1022 file(GLOB JavaScriptCore_SCRIPTS_SOURCES ${JavaScriptCore_SCRIPTS_SOURCES_PATHS})
1023
1024 foreach (_file ${JavaScriptCore_SCRIPTS_SOURCES})
1025     get_filename_component(_script "${_file}" NAME)
1026     add_custom_command(
1027         OUTPUT ${JavaScriptCore_SCRIPTS_DIR}/${_script}
1028         MAIN_DEPENDENCY ${_file}
1029         WORKING_DIRECTORY ${DERIVED_SOURCES_DIR}
1030         COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_file} ${JavaScriptCore_SCRIPTS_DIR}/${_script}
1031         VERBATIM)
1032     list(APPEND JavaScriptCore_SCRIPTS ${JavaScriptCore_SCRIPTS_DIR}/${_script})
1033 endforeach ()
1034
1035 set(UDIS_GEN_DEP
1036     disassembler/udis86/ud_opcode.py
1037 )
1038
1039 add_custom_command(
1040     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.c ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
1041     DEPENDS ${UDIS_GEN_DEP}
1042     WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
1043     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/disassembler/udis86/ud_itab.py ${JAVASCRIPTCORE_DIR}/disassembler/udis86/optable.xml ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
1044     VERBATIM)
1045
1046 list(APPEND JavaScriptCore_HEADERS
1047     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
1048 )
1049
1050 set(LLINT_ASM
1051     llint/LowLevelInterpreter.asm
1052     llint/LowLevelInterpreter32_64.asm
1053     llint/LowLevelInterpreter64.asm
1054 )
1055
1056 set(OFFLINE_ASM
1057     offlineasm/arm.rb
1058     offlineasm/arm64.rb
1059     offlineasm/ast.rb
1060     offlineasm/backends.rb
1061     offlineasm/cloop.rb
1062     offlineasm/config.rb
1063     offlineasm/instructions.rb
1064     offlineasm/mips.rb
1065     offlineasm/offsets.rb
1066     offlineasm/opt.rb
1067     offlineasm/parser.rb
1068     offlineasm/registers.rb
1069     offlineasm/risc.rb
1070     offlineasm/self_hash.rb
1071     offlineasm/settings.rb
1072     offlineasm/sh4.rb
1073     offlineasm/transform.rb
1074     offlineasm/x86.rb
1075 )
1076
1077 add_custom_command(
1078     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
1079     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/generate-bytecode-files
1080     DEPENDS ${JAVASCRIPTCORE_DIR}/generate-bytecode-files bytecode/BytecodeList.json
1081     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 ${JAVASCRIPTCORE_DIR}/bytecode/BytecodeList.json
1082     VERBATIM)
1083
1084 list(APPEND JavaScriptCore_HEADERS
1085     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
1086 )
1087
1088 add_custom_command(
1089     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
1090     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
1091     DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
1092     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
1093     VERBATIM)
1094
1095 # We add the header files directly to the ADD_EXECUTABLE call instead of setting the
1096 # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb and
1097 # generate-bytecode-files may not regenerate the .h files in case the hash it calculates does not change.
1098 # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMANDs above have
1099 # changed the command will always be called because the mtime of the .h files will
1100 # always be older than that of their dependencies.
1101 # Additionally, setting the OBJECT_DEPENDS property will make the .h files a Makefile
1102 # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
1103 # actually be run multiple times!
1104 add_executable(LLIntOffsetsExtractor
1105     ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
1106     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
1107 )
1108 target_link_libraries(LLIntOffsetsExtractor WTF)
1109
1110 # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
1111 # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
1112 # that generates a checksum of the LLIntOffsetsExtractor binary, if the checksum of the new
1113 # LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid
1114 # running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch)
1115 # after every asm.rb run.
1116 if (MSVC)
1117     set(LLIntOutput LowLevelInterpreterWin.asm)
1118     set(OFFLINE_ASM_ARGS --assembler=MASM)
1119 else ()
1120     set(LLIntOutput LLIntAssembly.h)
1121 endif ()
1122
1123 add_custom_command(
1124     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
1125     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
1126     DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
1127     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}
1128     COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
1129     WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
1130     VERBATIM)
1131
1132 # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
1133 # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
1134 # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
1135 # since it is used in the add_library() call at the end of this file.
1136 if (MSVC)
1137     enable_language(ASM_MASM)
1138     list(APPEND JavaScriptCore_SOURCES
1139         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
1140     )
1141     # Win32 needs /safeseh with assembly, but Win64 does not.
1142     if (CMAKE_SIZEOF_VOID_P EQUAL 4)
1143         set_source_files_properties(${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
1144             PROPERTIES COMPILE_FLAGS  "/safeseh"
1145         )
1146     endif ()
1147 else ()
1148     list(APPEND JavaScriptCore_HEADERS
1149         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
1150     )
1151 endif ()
1152
1153 # WebAssembly generator
1154
1155 macro(GENERATE_PYTHON _generator _input _output)
1156     add_custom_command(
1157         OUTPUT ${_output}
1158         MAIN_DEPENDENCY ${_generator}
1159         DEPENDS ${_input}
1160         COMMAND ${PYTHON_EXECUTABLE} ${_generator} ${_input} ${_output}
1161         VERBATIM)
1162     list(APPEND JavaScriptCore_HEADERS ${_output})
1163     ADD_SOURCE_DEPENDENCIES(${_input} ${_output})
1164 endmacro()
1165 GENERATE_PYTHON(${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasmOpsHeader.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/wasm.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WasmOps.h)
1166 GENERATE_PYTHON(${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasmValidateInlinesHeader.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/wasm.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WasmValidateInlines.h)
1167 GENERATE_PYTHON(${CMAKE_CURRENT_SOURCE_DIR}/wasm/generateWasmB3IRGeneratorInlinesHeader.py ${CMAKE_CURRENT_SOURCE_DIR}/wasm/wasm.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WasmB3IRGeneratorInlines.h)
1168
1169 # LUT generator
1170
1171 set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
1172 macro(GENERATE_HASH_LUT _input _output)
1173     add_custom_command(
1174         OUTPUT ${_output}
1175         MAIN_DEPENDENCY ${HASH_LUT_GENERATOR}
1176         DEPENDS ${_input}
1177         COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} > ${_output}
1178         VERBATIM)
1179     list(APPEND JavaScriptCore_HEADERS ${_output})
1180     ADD_SOURCE_DEPENDENCIES(${_input} ${_output})
1181 endmacro()
1182
1183 # GENERATOR 1-A: LUT creator
1184
1185 foreach (_file ${JavaScriptCore_OBJECT_LUT_SOURCES})
1186     get_filename_component(_name ${_file} NAME_WE)
1187     GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
1188 endforeach ()
1189
1190 set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES
1191     API
1192     assembler
1193     bindings
1194     builtins
1195     bytecode
1196     debugger
1197     dfg
1198     disassembler
1199     domjit
1200     heap
1201     inspector
1202     interpreter
1203     jit
1204     llint
1205     parser
1206     profiler
1207     replay
1208     runtime
1209     yarr
1210
1211     collector/handles
1212
1213     inspector/agents
1214     inspector/augmentable
1215     inspector/remote
1216 )
1217
1218 # GENERATOR 1-B: particular LUT creator (for 1 file only)
1219 GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
1220
1221 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
1222 add_custom_command(
1223     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
1224     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables
1225     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
1226     VERBATIM)
1227 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
1228
1229 add_custom_command(
1230     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/YarrCanonicalizeUnicode.cpp
1231     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/generateYarrCanonicalizeUnicode
1232     DEPENDS ${JAVASCRIPTCORE_DIR}/ucd/CaseFolding.txt
1233     COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/generateYarrCanonicalizeUnicode ${JAVASCRIPTCORE_DIR}/ucd/CaseFolding.txt ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/YarrCanonicalizeUnicode.cpp
1234     VERBATIM)
1235
1236 list(APPEND JavaScriptCore_SOURCES
1237     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/YarrCanonicalizeUnicode.cpp
1238 )
1239
1240 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
1241 add_custom_command(
1242     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
1243     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
1244     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table
1245     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
1246     VERBATIM)
1247 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
1248
1249
1250 # Inspector Interfaces
1251
1252 set(JavaScriptCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
1253
1254 set(JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS
1255     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
1256     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator.py
1257     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator_templates.py
1258     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_js_backend_commands.py
1259     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_header.py
1260     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_implementation.py
1261     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_header.py
1262     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_implementation.py
1263     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_header.py
1264     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_implementation.py
1265     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator.py
1266     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator_templates.py
1267     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/__init__.py
1268     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/models.py
1269 )
1270
1271 set(JavaScriptCore_INSPECTOR_DOMAINS
1272     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ApplicationCache.json
1273     ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json
1274     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
1275     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOM.json
1276     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMDebugger.json
1277     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMStorage.json
1278     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Database.json
1279     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Debugger.json
1280     ${JAVASCRIPTCORE_DIR}/inspector/protocol/GenericTypes.json
1281     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Heap.json
1282     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Inspector.json
1283     ${JAVASCRIPTCORE_DIR}/inspector/protocol/LayerTree.json
1284     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Network.json
1285     ${JAVASCRIPTCORE_DIR}/inspector/protocol/OverlayTypes.json
1286     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Page.json
1287     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Runtime.json
1288     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ScriptProfiler.json
1289     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Timeline.json
1290     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Worker.json
1291 )
1292
1293 if (ENABLE_INDEXED_DATABASE)
1294     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1295         ${JAVASCRIPTCORE_DIR}/inspector/protocol/IndexedDB.json
1296     )
1297 endif ()
1298
1299 if (ENABLE_RESOURCE_USAGE)
1300     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1301         ${JAVASCRIPTCORE_DIR}/inspector/protocol/Memory.json
1302     )
1303 endif ()
1304
1305 if (ENABLE_WEB_REPLAY)
1306     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1307         ${JAVASCRIPTCORE_DIR}/inspector/protocol/Replay.json
1308     )
1309 endif ()
1310
1311 add_custom_command(
1312     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1313     MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-combined-inspector-json.py
1314     DEPENDS ${JavaScriptCore_INSPECTOR_DOMAINS}
1315     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-combined-inspector-json.py ${JavaScriptCore_INSPECTOR_DOMAINS} > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1316     VERBATIM)
1317
1318 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
1319 file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol)
1320 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
1321 add_custom_command(
1322     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
1323            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1324            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.cpp
1325            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1326            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.cpp
1327            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1328            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
1329     MAIN_DEPENDENCY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1330     DEPENDS ${JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS}
1331     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
1332     VERBATIM)
1333
1334 # JSCBuiltins
1335
1336 set(BUILTINS_GENERATOR_SCRIPTS
1337     ${JavaScriptCore_SCRIPTS_DIR}/builtins.py
1338     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generator.py
1339     ${JavaScriptCore_SCRIPTS_DIR}/builtins_model.py
1340     ${JavaScriptCore_SCRIPTS_DIR}/builtins_templates.py
1341     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_combined_header.py
1342     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_combined_implementation.py
1343     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_header.py
1344     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_implementation.py
1345     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_wrapper_header.py
1346     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_wrapper_implementation.py
1347     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_internals_wrapper_header.py
1348     ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_internals_wrapper_implementation.py
1349     ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
1350     ${JavaScriptCore_SCRIPTS_DIR}/lazywriter.py
1351 )
1352
1353 set(JavaScriptCore_BUILTINS_SOURCES
1354     ${JAVASCRIPTCORE_DIR}/builtins/ArrayConstructor.js
1355     ${JAVASCRIPTCORE_DIR}/builtins/ArrayIteratorPrototype.js
1356     ${JAVASCRIPTCORE_DIR}/builtins/ArrayPrototype.js
1357     ${JAVASCRIPTCORE_DIR}/builtins/AsyncFunctionPrototype.js
1358     ${JAVASCRIPTCORE_DIR}/builtins/DatePrototype.js
1359     ${JAVASCRIPTCORE_DIR}/builtins/FunctionPrototype.js
1360     ${JAVASCRIPTCORE_DIR}/builtins/GeneratorPrototype.js
1361     ${JAVASCRIPTCORE_DIR}/builtins/GlobalObject.js
1362     ${JAVASCRIPTCORE_DIR}/builtins/GlobalOperations.js
1363     ${JAVASCRIPTCORE_DIR}/builtins/InspectorInstrumentationObject.js
1364     ${JAVASCRIPTCORE_DIR}/builtins/InternalPromiseConstructor.js
1365     ${JAVASCRIPTCORE_DIR}/builtins/IteratorHelpers.js
1366     ${JAVASCRIPTCORE_DIR}/builtins/IteratorPrototype.js
1367     ${JAVASCRIPTCORE_DIR}/builtins/MapPrototype.js
1368     ${JAVASCRIPTCORE_DIR}/builtins/ModuleLoaderPrototype.js
1369     ${JAVASCRIPTCORE_DIR}/builtins/NumberConstructor.js
1370     ${JAVASCRIPTCORE_DIR}/builtins/NumberPrototype.js
1371     ${JAVASCRIPTCORE_DIR}/builtins/ObjectConstructor.js
1372     ${JAVASCRIPTCORE_DIR}/builtins/PromiseConstructor.js
1373     ${JAVASCRIPTCORE_DIR}/builtins/PromiseOperations.js
1374     ${JAVASCRIPTCORE_DIR}/builtins/PromisePrototype.js
1375     ${JAVASCRIPTCORE_DIR}/builtins/ReflectObject.js
1376     ${JAVASCRIPTCORE_DIR}/builtins/RegExpPrototype.js
1377     ${JAVASCRIPTCORE_DIR}/builtins/SetPrototype.js
1378     ${JAVASCRIPTCORE_DIR}/builtins/StringConstructor.js
1379     ${JAVASCRIPTCORE_DIR}/builtins/StringIteratorPrototype.js
1380     ${JAVASCRIPTCORE_DIR}/builtins/StringPrototype.js
1381     ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayConstructor.js
1382     ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayPrototype.js
1383 )
1384
1385 add_custom_command(
1386     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcode.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcodeGenerated.h
1387     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/b3/air/AirOpcode.opcodes
1388     DEPENDS ${JAVASCRIPTCORE_DIR}/b3/air/opcode_generator.rb
1389     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/b3/air/opcode_generator.rb ${JAVASCRIPTCORE_DIR}/b3/air/AirOpcode.opcodes VERBATIM
1390     WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
1391 )
1392
1393 list(APPEND JavaScriptCore_SOURCES
1394     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcode.h
1395     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/AirOpcodeGenerated.h
1396 )
1397
1398 add_custom_command(
1399     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1400     MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
1401     DEPENDS ${JavaScriptCore_BUILTINS_SOURCES} ${BUILTINS_GENERATOR_SCRIPTS}
1402     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py --framework JavaScriptCore --output-directory ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} --combined ${JavaScriptCore_BUILTINS_SOURCES}
1403     VERBATIM)
1404
1405 list(APPEND JavaScriptCore_SOURCES
1406     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
1407     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.cpp
1408     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.cpp
1409     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp
1410 )
1411
1412 list(APPEND JavaScriptCore_HEADERS
1413     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1414     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1415     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1416     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1417 )
1418
1419 add_custom_command(
1420     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1421     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js
1422     DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
1423     COMMAND ${CMAKE_COMMAND} -E echo "//# sourceURL=__InjectedScript_InjectedScriptSource.js" > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1424     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py < ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js >> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1425     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h
1426     VERBATIM)
1427
1428 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h)
1429
1430 # Web Replay inputs generator
1431 if (ENABLE_WEB_REPLAY)
1432     set(JavaScript_WEB_REPLAY_INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/replay/JSInputs.json)
1433     add_custom_command(
1434         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.cpp
1435         MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/replay/scripts/CodeGeneratorReplayInputs.py
1436         DEPENDS ${JavaScript_WEB_REPLAY_INPUTS}
1437         COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/replay/scripts/CodeGeneratorReplayInputs.py --outputDir ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ --framework JavaScriptCore ${JavaScript_WEB_REPLAY_INPUTS}
1438         VERBATIM)
1439
1440     list(APPEND JavaScriptCore_SOURCES
1441         replay/EncodedValue.cpp
1442         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.cpp
1443     )
1444     list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h)
1445 endif ()
1446
1447 if (WTF_CPU_ARM)
1448 elseif (WTF_CPU_ARM64)
1449 elseif (WTF_CPU_HPPA)
1450 elseif (WTF_CPU_PPC)
1451 elseif (WTF_CPU_PPC64)
1452 elseif (WTF_CPU_PPC64LE)
1453 elseif (WTF_CPU_S390)
1454 elseif (WTF_CPU_S390X)
1455 elseif (WTF_CPU_MIPS)
1456 elseif (WTF_CPU_SH4)
1457 elseif (WTF_CPU_X86)
1458 elseif (WTF_CPU_X86_64)
1459     if (MSVC AND ENABLE_JIT)
1460         add_custom_command(
1461             OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
1462             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1463             COMMAND ml64 -nologo -c -Fo ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1464             VERBATIM)
1465
1466         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj)
1467     endif ()
1468 else ()
1469     message(FATAL_ERROR "Unknown CPU")
1470 endif ()
1471
1472
1473 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
1474
1475 WEBKIT_CREATE_FORWARDING_HEADERS(JavaScriptCore DIRECTORIES ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES} FILES ${JavaScriptCore_FORWARDING_HEADERS_FILES})
1476
1477 target_include_directories(LLIntOffsetsExtractor PRIVATE ${JavaScriptCore_INCLUDE_DIRECTORIES})
1478
1479 add_subdirectory(shell)
1480
1481 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
1482 WEBKIT_FRAMEWORK(JavaScriptCore)
1483
1484 if (NOT "${PORT}" STREQUAL "Mac")
1485     if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
1486         POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE)
1487         set_target_properties(JavaScriptCore PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR})
1488         install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}")
1489     endif ()
1490 endif ()
1491
1492 # Force staging of shared scripts, even if they aren't directly used to build JavaScriptCore.
1493
1494 add_custom_target(stageSharedScripts DEPENDS ${JavaScriptCore_SCRIPTS})
1495 add_dependencies(JavaScriptCore stageSharedScripts)
1496
1497 if (MSVC)
1498     add_custom_command(
1499         TARGET JavaScriptCore
1500         PRE_BUILD
1501         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/auto-version.pl ${DERIVED_SOURCES_DIR}
1502         VERBATIM)
1503
1504     add_custom_command(
1505         TARGET JavaScriptCore
1506         POST_BUILD
1507         COMMAND ${PERL_EXECUTABLE} ${WEBKIT_LIBRARIES_DIR}/tools/scripts/version-stamp.pl ${DERIVED_SOURCES_DIR} $<TARGET_FILE:JavaScriptCore>
1508         VERBATIM)
1509 endif ()