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