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