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