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