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