fda72c90851b908ce1b4645e780487f01a356ea8
[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/CallLinkInfo.cpp
70     bytecode/CallLinkStatus.cpp
71     bytecode/CallVariant.cpp
72     bytecode/CodeBlock.cpp
73     bytecode/CodeBlockHash.cpp
74     bytecode/CodeBlockJettisoningWatchpoint.cpp
75     bytecode/CodeOrigin.cpp
76     bytecode/CodeType.cpp
77     bytecode/ComplexGetStatus.cpp
78     bytecode/ConstantStructureCheck.cpp
79     bytecode/DFGExitProfile.cpp
80     bytecode/DeferredCompilationCallback.cpp
81     bytecode/ExecutionCounter.cpp
82     bytecode/ExitKind.cpp
83     bytecode/ExitingJITType.cpp
84     bytecode/GetByIdStatus.cpp
85     bytecode/GetByIdVariant.cpp
86     bytecode/InlineCallFrameSet.cpp
87     bytecode/JumpTable.cpp
88     bytecode/LazyOperandValueProfile.cpp
89     bytecode/MethodOfGettingAValueProfile.cpp
90     bytecode/Opcode.cpp
91     bytecode/PolymorphicGetByIdList.cpp
92     bytecode/PolymorphicPutByIdList.cpp
93     bytecode/PreciseJumpTargets.cpp
94     bytecode/PutByIdStatus.cpp
95     bytecode/PutByIdVariant.cpp
96     bytecode/ReduceWhitespace.cpp
97     bytecode/SamplingTool.cpp
98     bytecode/SpecialPointer.cpp
99     bytecode/SpeculatedType.cpp
100     bytecode/StructureSet.cpp
101     bytecode/StructureStubClearingWatchpoint.cpp
102     bytecode/StructureStubInfo.cpp
103     bytecode/ToThisStatus.cpp
104     bytecode/UnlinkedCodeBlock.cpp
105     bytecode/UnlinkedInstructionStream.cpp
106     bytecode/ValueRecovery.cpp
107     bytecode/VariableWatchpointSet.cpp
108     bytecode/VirtualRegister.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/ExecutableAllocator.cpp
331     jit/ExecutableAllocatorFixedVMPool.cpp
332     jit/GCAwareJITStubRoutine.cpp
333     jit/HostCallReturnValue.cpp
334     jit/JIT.cpp
335     jit/JITArithmetic.cpp
336     jit/JITArithmetic32_64.cpp
337     jit/JITCall.cpp
338     jit/JITCall32_64.cpp
339     jit/JITCode.cpp
340     jit/JITDisassembler.cpp
341     jit/JITExceptions.cpp
342     jit/JITInlineCacheGenerator.cpp
343     jit/JITOpcodes.cpp
344     jit/JITOpcodes32_64.cpp
345     jit/JITOperations.cpp
346     jit/JITPropertyAccess.cpp
347     jit/JITPropertyAccess32_64.cpp
348     jit/JITStubRoutine.cpp
349     jit/JITStubs.cpp
350     jit/JITThunks.cpp
351     jit/JITToDFGDeferredCompilationCallback.cpp
352     jit/SetupVarargsFrame.cpp
353     jit/PolymorphicCallStubRoutine.cpp
354     jit/Reg.cpp
355     jit/RegisterPreservationWrapperGenerator.cpp
356     jit/RegisterSet.cpp
357     jit/Repatch.cpp
358     jit/ScratchRegisterAllocator.cpp
359     jit/TempRegisterSet.cpp
360     jit/ThunkGenerators.cpp
361
362     parser/Lexer.cpp
363     parser/Nodes.cpp
364     parser/Parser.cpp
365     parser/ParserArena.cpp
366     parser/SourceCode.cpp
367     parser/SourceProvider.cpp
368     parser/SourceProviderCache.cpp
369
370     profiler/LegacyProfiler.cpp
371     profiler/Profile.cpp
372     profiler/ProfileGenerator.cpp
373     profiler/ProfileNode.cpp
374     profiler/ProfilerBytecode.cpp
375     profiler/ProfilerBytecodeSequence.cpp
376     profiler/ProfilerBytecodes.cpp
377     profiler/ProfilerCompilation.cpp
378     profiler/ProfilerCompilationKind.cpp
379     profiler/ProfilerCompiledBytecode.cpp
380     profiler/ProfilerDatabase.cpp
381     profiler/ProfilerJettisonReason.cpp
382     profiler/ProfilerOSRExit.cpp
383     profiler/ProfilerOSRExitSite.cpp
384     profiler/ProfilerOrigin.cpp
385     profiler/ProfilerOriginStack.cpp
386     profiler/ProfilerProfiledBytecodes.cpp
387
388     tools/CodeProfile.cpp
389     tools/CodeProfiling.cpp
390
391     yarr/RegularExpression.cpp
392     yarr/YarrCanonicalizeUCS2.cpp
393     yarr/YarrInterpreter.cpp
394     yarr/YarrJIT.cpp
395     yarr/YarrPattern.cpp
396     yarr/YarrSyntaxChecker.cpp
397 )
398
399 set(JavaScriptCore_RUNTIME_SOURCES
400     runtime/ArgList.cpp
401     runtime/Arguments.cpp
402     runtime/ArgumentsIteratorConstructor.cpp
403     runtime/ArgumentsIteratorPrototype.cpp
404     runtime/ArrayBuffer.cpp
405     runtime/ArrayBufferNeuteringWatchpoint.cpp
406     runtime/ArrayBufferView.cpp
407     runtime/ArrayConstructor.cpp
408     runtime/ArrayIteratorConstructor.cpp
409     runtime/ArrayIteratorPrototype.cpp
410     runtime/ArrayPrototype.cpp
411     runtime/BasicBlockLocation.cpp
412     runtime/BooleanConstructor.cpp
413     runtime/BooleanObject.cpp
414     runtime/BooleanPrototype.cpp
415     runtime/BundlePath.cpp
416     runtime/CallData.cpp
417     runtime/CodeCache.cpp
418     runtime/CodeSpecializationKind.cpp
419     runtime/CommonIdentifiers.cpp
420     runtime/CommonSlowPaths.cpp
421     runtime/CommonSlowPathsExceptions.cpp
422     runtime/CompilationResult.cpp
423     runtime/Completion.cpp
424     runtime/ConsoleClient.cpp
425     runtime/ConsolePrototype.cpp
426     runtime/ConstructData.cpp
427     runtime/ControlFlowProfiler.cpp
428     runtime/CustomGetterSetter.cpp
429     runtime/DataView.cpp
430     runtime/DateConstructor.cpp
431     runtime/DateConversion.cpp
432     runtime/DateInstance.cpp
433     runtime/DatePrototype.cpp
434     runtime/DumpContext.cpp
435     runtime/Error.cpp
436     runtime/ErrorConstructor.cpp
437     runtime/ErrorHandlingScope.cpp
438     runtime/ErrorInstance.cpp
439     runtime/ErrorPrototype.cpp
440     runtime/ExceptionFuzz.cpp
441     runtime/ExceptionHelpers.cpp 
442     runtime/Executable.cpp
443     runtime/FunctionConstructor.cpp
444     runtime/FunctionExecutableDump.cpp
445     runtime/FunctionHasExecutedCache.cpp
446     runtime/FunctionPrototype.cpp
447     runtime/GetterSetter.cpp
448     runtime/Identifier.cpp
449     runtime/IndexingType.cpp
450     runtime/InitializeThreading.cpp
451     runtime/IntendedStructureChain.cpp
452     runtime/InternalFunction.cpp
453     runtime/JSAPIValueWrapper.cpp
454     runtime/JSLexicalEnvironment.cpp
455     runtime/JSArgumentsIterator.cpp
456     runtime/JSArray.cpp
457     runtime/JSArrayBuffer.cpp
458     runtime/JSArrayBufferConstructor.cpp
459     runtime/JSArrayBufferPrototype.cpp
460     runtime/JSArrayBufferView.cpp
461     runtime/JSArrayIterator.cpp
462     runtime/JSBoundFunction.cpp
463     runtime/JSGlobalObjectDebuggable.cpp
464     runtime/JSCJSValue.cpp
465     runtime/JSCallee.cpp
466     runtime/JSCell.cpp
467     runtime/JSConsole.cpp
468     runtime/JSDataView.cpp
469     runtime/JSDataViewPrototype.cpp
470     runtime/JSDateMath.cpp
471     runtime/JSEnvironmentRecord.cpp
472     runtime/JSFunction.cpp
473     runtime/JSGlobalObject.cpp
474     runtime/JSGlobalObjectFunctions.cpp
475     runtime/JSLock.cpp
476     runtime/JSMap.cpp
477     runtime/JSMapIterator.cpp
478     runtime/JSNameScope.cpp
479     runtime/JSNotAnObject.cpp
480     runtime/JSONObject.cpp
481     runtime/JSObject.cpp
482     runtime/JSPromise.cpp
483     runtime/JSPromiseConstructor.cpp
484     runtime/JSPromiseDeferred.cpp
485     runtime/JSPromiseFunctions.cpp
486     runtime/JSPromiseReaction.cpp
487     runtime/JSPromisePrototype.cpp
488     runtime/JSProxy.cpp
489     runtime/JSPropertyNameEnumerator.cpp
490     runtime/JSScope.cpp
491     runtime/JSSegmentedVariableObject.cpp
492     runtime/JSSet.cpp
493     runtime/JSSetIterator.cpp
494     runtime/JSString.cpp
495     runtime/JSStringJoiner.cpp
496     runtime/JSSymbolTableObject.cpp
497     runtime/JSTypedArrayConstructors.cpp
498     runtime/JSTypedArrayPrototypes.cpp
499     runtime/JSTypedArrays.cpp
500     runtime/JSWeakMap.cpp
501     runtime/JSWithScope.cpp
502     runtime/JSWrapperObject.cpp
503     runtime/LiteralParser.cpp
504     runtime/Lookup.cpp
505     runtime/MapConstructor.cpp
506     runtime/MapData.cpp
507     runtime/MapIteratorConstructor.cpp
508     runtime/MapIteratorPrototype.cpp
509     runtime/MapPrototype.cpp
510     runtime/MathCommon.cpp
511     runtime/MathObject.cpp
512     runtime/MemoryStatistics.cpp
513     runtime/NativeErrorConstructor.cpp
514     runtime/NativeErrorPrototype.cpp
515     runtime/NullGetterFunction.cpp
516     runtime/NullSetterFunction.cpp
517     runtime/NumberConstructor.cpp
518     runtime/NumberObject.cpp
519     runtime/NumberPrototype.cpp
520     runtime/ObjectConstructor.cpp
521     runtime/ObjectPrototype.cpp
522     runtime/Operations.cpp
523     runtime/Options.cpp
524     runtime/PropertyDescriptor.cpp
525     runtime/PropertyNameArray.cpp
526     runtime/PropertySlot.cpp
527     runtime/PropertyTable.cpp
528     runtime/PrototypeMap.cpp
529     runtime/RegExp.cpp
530     runtime/RegExpCache.cpp
531     runtime/RegExpCachedResult.cpp
532     runtime/RegExpConstructor.cpp
533     runtime/RegExpMatchesArray.cpp
534     runtime/RegExpObject.cpp
535     runtime/RegExpPrototype.cpp
536     runtime/SamplingCounter.cpp
537     runtime/SetConstructor.cpp
538     runtime/SetIteratorConstructor.cpp
539     runtime/SetIteratorPrototype.cpp
540     runtime/SetPrototype.cpp
541     runtime/SimpleTypedArrayController.cpp
542     runtime/SmallStrings.cpp
543     runtime/SparseArrayValueMap.cpp
544     runtime/StrictEvalActivation.cpp
545     runtime/StringConstructor.cpp
546     runtime/StringObject.cpp
547     runtime/StringPrototype.cpp
548     runtime/StringRecursionChecker.cpp
549     runtime/Structure.cpp
550     runtime/StructureChain.cpp
551     runtime/StructureIDTable.cpp
552     runtime/StructureRareData.cpp
553     runtime/Symbol.cpp
554     runtime/SymbolObject.cpp
555     runtime/SymbolPrototype.cpp
556     runtime/SymbolConstructor.cpp
557     runtime/SymbolTable.cpp
558     runtime/TestRunnerUtils.cpp
559     runtime/TypeLocationCache.cpp
560     runtime/TypeProfiler.cpp
561     runtime/TypeProfilerLog.cpp
562     runtime/TypeSet.cpp
563     runtime/TypedArrayController.cpp
564     runtime/TypedArrayType.cpp
565     runtime/VM.cpp
566     runtime/VMEntryScope.cpp
567     runtime/Watchdog.cpp
568     runtime/WatchdogNone.cpp
569     runtime/WeakMapConstructor.cpp
570     runtime/WeakMapData.cpp
571     runtime/WeakMapPrototype.cpp
572 )
573
574 list(APPEND JavaScriptCore_SOURCES
575     ${JavaScriptCore_RUNTIME_SOURCES}
576 )
577
578 set(JavaScriptCore_LUT_FILES
579     runtime/ArrayConstructor.cpp
580     runtime/ArrayPrototype.cpp
581     runtime/BooleanPrototype.cpp
582     runtime/DateConstructor.cpp
583     runtime/DatePrototype.cpp
584     runtime/ErrorPrototype.cpp
585     runtime/JSDataViewPrototype.cpp
586     runtime/JSGlobalObject.cpp
587     runtime/JSONObject.cpp
588     runtime/JSPromiseConstructor.cpp
589     runtime/JSPromisePrototype.cpp
590     runtime/NumberConstructor.cpp
591     runtime/NumberPrototype.cpp
592     runtime/ObjectConstructor.cpp
593     runtime/RegExpConstructor.cpp
594     runtime/RegExpObject.cpp
595     runtime/RegExpPrototype.cpp
596     runtime/StringConstructor.cpp
597     runtime/SymbolPrototype.cpp
598 )
599
600 set(JavaScriptCore_LIBRARIES
601     WTF
602     ${ICU_I18N_LIBRARIES}
603 )
604
605 if (WTF_USE_UDIS86)
606     set(UDIS_GEN_DEP
607         disassembler/udis86/ud_opcode.py
608         disassembler/udis86/ud_optable.py
609     )
610
611     add_custom_command(
612         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.c ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
613         DEPENDS ${UDIS_GEN_DEP}
614         WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
615         COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/disassembler/udis86/itab.py ${JAVASCRIPTCORE_DIR}/disassembler/udis86/optable.xml
616         VERBATIM)
617
618     list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
619         ${JAVASCRIPTCORE_DIR}/disassembler/udis86
620     )
621     list(APPEND JavaScriptCore_HEADERS
622         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
623     )
624     list(APPEND JavaScriptCore_SOURCES
625         disassembler/udis86/udis86.c
626         disassembler/udis86/udis86_decode.c
627         disassembler/udis86/udis86_input.c
628         disassembler/udis86/udis86_itab_holder.c
629         disassembler/udis86/udis86_syn-att.c
630         disassembler/udis86/udis86_syn-intel.c
631         disassembler/udis86/udis86_syn.c
632         disassembler/UDis86Disassembler.cpp
633     )
634 endif ()
635
636 # We cannot check for RUBY_FOUND because it is set only when the full package is installed and
637 # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
638 # for finding the only Ruby interpreter.
639 if (NOT RUBY_EXECUTABLE)
640     message(FATAL_ERROR "The Ruby interpreter is needed to generate LLInt files.")
641 endif ()
642
643 set(LLINT_ASM
644     llint/LowLevelInterpreter.asm
645     llint/LowLevelInterpreter32_64.asm
646     llint/LowLevelInterpreter64.asm
647 )
648
649 set(OFFLINE_ASM
650     offlineasm/arm.rb
651     offlineasm/arm64.rb
652     offlineasm/ast.rb
653     offlineasm/backends.rb
654     offlineasm/cloop.rb
655     offlineasm/config.rb
656     offlineasm/instructions.rb
657     offlineasm/mips.rb
658     offlineasm/offsets.rb
659     offlineasm/opt.rb
660     offlineasm/parser.rb
661     offlineasm/registers.rb
662     offlineasm/risc.rb
663     offlineasm/self_hash.rb
664     offlineasm/settings.rb
665     offlineasm/sh4.rb
666     offlineasm/transform.rb
667     offlineasm/x86.rb
668 )
669
670 add_custom_command(
671     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
672     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/generate-bytecode-files
673     DEPENDS ${JAVASCRIPTCORE_DIR}/generate-bytecode-files bytecode/BytecodeList.json
674     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
675     VERBATIM)
676
677 add_custom_command(
678     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
679     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
680     DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
681     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
682     VERBATIM)
683
684 # We add the header files directly to the ADD_EXECUTABLE call instead of setting the
685 # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb and
686 # generate-bytecode-files may not regenerate the .h files in case the hash it calculates does not change.
687 # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMANDs above have
688 # changed the command will always be called because the mtime of the .h files will
689 # always be older than that of their dependencies.
690 # Additionally, setting the OBJECT_DEPENDS property will make the .h files a Makefile
691 # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
692 # actually be run multiple times!
693 add_executable(LLIntOffsetsExtractor
694     ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
695     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
696 )
697 target_link_libraries(LLIntOffsetsExtractor WTF)
698
699 # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
700 # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
701 # that generates a checksum of the LLIntOffsetsExtractor binary, if the checksum of the new
702 # LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid
703 # running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch)
704 # after every asm.rb run.
705 if (MSVC)
706     set(LLIntOutput LowLevelInterpreterWin.asm)
707 else ()
708     set(LLIntOutput LLIntAssembly.h)
709 endif ()
710
711 add_custom_command(
712     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
713     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
714     DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
715     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}
716     COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
717     VERBATIM)
718
719 # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
720 # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
721 # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
722 # since it is used in the add_library() call at the end of this file.
723 if (MSVC)
724     list(APPEND JavaScriptCore_SOURCES
725         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
726     )
727     # Win32 needs /safeseh with assembly, but Win64 does not.
728     if (CMAKE_SIZEOF_VOID_P EQUAL 4)
729         set_source_files_properties(${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
730             PROPERTIES COMPILE_FLAGS  "/safeseh"
731         )
732     endif ()
733 else ()
734     list(APPEND JavaScriptCore_HEADERS
735         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
736     )
737 endif ()
738
739 list(APPEND JavaScriptCore_SOURCES
740     llint/LLIntCLoop.cpp
741     llint/LLIntData.cpp
742     llint/LLIntEntrypoint.cpp
743     llint/LLIntExceptions.cpp
744     llint/LLIntSlowPaths.cpp
745     llint/LLIntThunks.cpp
746     llint/LowLevelInterpreter.cpp
747 )
748
749
750 if (ENABLE_FTL_JIT)
751     if (NOT LLVM_STATIC_LIBRARIES)
752         message(FATAL_ERROR "No LLVM libs found, but FTL is enabled. Stopping build.")
753     endif ()
754
755     # Configure llvmForJSC.so
756     set(llvmForJSC_SOURCES
757         llvm/library/LLVMAnchor.cpp
758         llvm/library/LLVMExports.cpp
759         llvm/library/LLVMOverrides.cpp
760     )
761     set(llvmForJSC_INCLUDE_DIRECTORIES
762         ${LLVM_INCLUDE_DIRS}
763         "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
764     )
765
766     add_custom_command(
767         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h
768         DEPENDS ${LLVM_STATIC_LIBRARIES}
769         COMMAND ${CMAKE_COMMAND} -E touch ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h
770         VERBATIM)
771
772     if (ENABLE_FTL_NATIVE_CALL_INLINING)
773         function(JOIN VALUES GLUE OUTPUT)
774             string(REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
775             set(${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
776         endfunction()
777
778         JOIN("${JavaScriptCore_INCLUDE_DIRECTORIES}" " -I" JSC_INCLUDES)
779
780         set(LLVM_BITCODE_FILES)
781
782         foreach (_file ${JavaScriptCore_RUNTIME_SOURCES})
783             get_filename_component(_name ${_file} NAME_WE)
784             add_custom_command(
785                 OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/${_name}.bc
786                 COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create-llvm-ir-from-source-file.py ${_file} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CLANG_EXE} "${JSC_INCLUDES}"
787                 WORKING_DIRECTORY "${JAVASCRIPTCORE_DIR}"
788                 VERBATIM)
789
790             ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/ftl/FTLState.cpp ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/${_name}.bc)
791             list(APPEND LLVM_BITCODE_FILES
792                 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/${_name}.bc
793             )
794         endforeach ()
795
796         get_filename_component(LLVM_BINS ${LLVM_CONFIG_EXE} PATH)
797
798         add_custom_command(
799             OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InlineRuntimeSymbolTable.h
800             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create-symbol-table-index.py
801             DEPENDS ${LLVM_BITCODE_FILES}
802             COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create-symbol-table-index.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${JAVASCRIPTCORE_DIR} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} ${LLVM_BINS}
803             WORKING_DIRECTORY "${JAVASCRIPTCORE_DIR}"
804             VERBATIM)
805
806         ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/ftl/FTLState.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InlineRuntimeSymbolTable.h)
807     endif ()
808
809     WEBKIT_WRAP_SOURCELIST(${llvmForJSC_SOURCES})
810     add_library(llvmForJSC SHARED ${llvmForJSC_SOURCES} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h)
811     target_link_libraries(llvmForJSC ${LLVM_STATIC_LIBRARIES} "pthread" "dl")
812
813     # Added extra items for JavaScriptCore
814     list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
815         ${LLVM_INCLUDE_DIRS}
816     )
817
818     list(APPEND JavaScriptCore_SOURCES
819         dfg/DFGToFTLDeferredCompilationCallback.cpp
820         dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp
821
822         disassembler/LLVMDisassembler.cpp
823         disassembler/X86Disassembler.cpp
824
825         ftl/FTLAbstractHeap.cpp
826         ftl/FTLAbstractHeapRepository.cpp
827         ftl/FTLAvailableRecovery.cpp
828         ftl/FTLCapabilities.cpp
829         ftl/FTLCommonValues.cpp
830         ftl/FTLCompile.cpp
831         ftl/FTLDWARFDebugLineInfo.cpp
832         ftl/FTLDWARFRegister.cpp
833         ftl/FTLDataSection.cpp
834         ftl/FTLExitArgument.cpp
835         ftl/FTLExitArgumentForOperand.cpp
836         ftl/FTLExitPropertyValue.cpp
837         ftl/FTLExitThunkGenerator.cpp
838         ftl/FTLExitTimeObjectMaterialization.cpp
839         ftl/FTLExitValue.cpp
840         ftl/FTLFail.cpp
841         ftl/FTLForOSREntryJITCode.cpp
842         ftl/FTLInlineCacheSize.cpp
843         ftl/FTLIntrinsicRepository.cpp
844         ftl/FTLJITCode.cpp
845         ftl/FTLJITFinalizer.cpp
846         ftl/FTLJSCall.cpp
847         ftl/FTLJSCallBase.cpp
848         ftl/FTLJSCallVarargs.cpp
849         ftl/FTLLink.cpp
850         ftl/FTLLocation.cpp
851         ftl/FTLLowerDFGToLLVM.cpp
852         ftl/FTLOSREntry.cpp
853         ftl/FTLOSRExitCompiler.cpp
854         ftl/FTLOSRExit.cpp
855         ftl/FTLOperations.cpp
856         ftl/FTLOutput.cpp
857         ftl/FTLRecoveryOpcode.cpp
858         ftl/FTLRegisterAtOffset.cpp
859         ftl/FTLSaveRestore.cpp
860         ftl/FTLSlowPathCall.cpp
861         ftl/FTLSlowPathCallKey.cpp
862         ftl/FTLStackMaps.cpp
863         ftl/FTLState.cpp
864         ftl/FTLThunks.cpp
865         ftl/FTLUnwindInfo.cpp
866         ftl/FTLValueFormat.cpp
867         ftl/FTLValueRange.cpp
868
869         llvm/InitializeLLVM.cpp
870         llvm/InitializeLLVMLinux.cpp
871         llvm/InitializeLLVMPOSIX.cpp
872         llvm/LLVMAPI.cpp
873     )
874 endif ()
875
876 set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
877 macro(GENERATE_HASH_LUT _input _output)
878     add_custom_command(
879         OUTPUT ${_output}
880         DEPENDS ${HASH_LUT_GENERATOR} ${_input} ${CMAKE_CURRENT_SOURCE_DIR}/generate-js-builtins
881         COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} -i > ${_output}
882         VERBATIM)
883     list(APPEND JavaScriptCore_HEADERS ${_output})
884 endmacro()
885
886 # GENERATOR 1-A: LUT creator
887 foreach (_file ${JavaScriptCore_LUT_FILES})
888     get_filename_component(_name ${_file} NAME_WE)
889     GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
890 endforeach ()
891
892 set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES
893     assembler
894     bindings
895     bytecode
896     debugger
897     heap
898     inspector
899     inspector/agents
900     inspector/remote
901     interpreter
902     jit
903     llint
904     parser
905     profiler
906     runtime
907     yarr
908
909     collector/handles
910     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
911 )
912
913 set(JavaScriptCore_FORWARDING_HEADERS_FILES
914     API/APICallbackFunction.h
915     API/APICast.h
916     API/JSAPIWrapperObject.h
917     API/JSBase.h
918     API/JSBasePrivate.h
919     API/JSCTestRunnerUtils.h
920     API/JSCallbackConstructor.h
921     API/JSCallbackFunction.h
922     API/JSCallbackObject.h
923     API/JSCallbackObjectFunctions.h
924     API/JSClassRef.h
925     API/JSContext.h
926     API/JSContextInternal.h
927     API/JSContextPrivate.h
928     API/JSContextRef.h
929     API/JSContextRefInternal.h
930     API/JSContextRefPrivate.h
931     API/JSExport.h
932     API/JSManagedValue.h
933     API/JSManagedValueInternal.h
934     API/JSObjectRef.h
935     API/JSObjectRefPrivate.h
936     API/JSProfilerPrivate.h
937     API/JSRetainPtr.h
938     API/JSScriptRefPrivate.h
939     API/JSStringRef.h
940     API/JSStringRefBSTR.h
941     API/JSStringRefCF.h
942     API/JSStringRefPrivate.h
943     API/JSValue.h
944     API/JSValueInternal.h
945     API/JSValueRef.h
946     API/JSVirtualMachine.h
947     API/JSVirtualMachineInternal.h
948     API/JSWeakObjectMapRefInternal.h
949     API/JSWeakObjectMapRefPrivate.h
950     API/JSWrapperMap.h
951     API/JavaScript.h
952     API/JavaScriptCore.h
953     API/ObjcRuntimeExtras.h
954     API/OpaqueJSString.h
955     API/WebKitAvailability.h
956
957     assembler/LinkBuffer.h
958     assembler/MacroAssembler.h
959     assembler/MacroAssemblerCodeRef.h
960     assembler/MacroAssemblerCodeRef.h
961
962     inspector/remote/RemoteInspector.h
963     inspector/remote/RemoteInspectorConstants.h
964     inspector/remote/RemoteInspectorDebuggable.h
965     inspector/remote/RemoteInspectorDebuggableConnection.h
966     inspector/remote/RemoteInspectorXPCConnection.h
967
968     jit/GPRInfo.h
969
970     runtime/VM.h
971
972     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
973     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h
974     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
975 )
976
977
978 # GENERATOR 1-B: particular LUT creator (for 1 file only)
979 GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
980
981 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
982 add_custom_command(
983     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
984     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables
985     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
986     VERBATIM)
987 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
988
989
990 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
991 add_custom_command(
992     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
993     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
994     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
995     VERBATIM)
996 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
997
998
999 # Inspector Interfaces
1000
1001 set(JavaScriptCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
1002
1003 set(JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS
1004     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
1005     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator.py
1006     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator_templates.py
1007     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_js_backend_commands.py
1008     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_header.py
1009     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_implementation.py
1010     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_header.py
1011     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_implementation.py
1012     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_header.py
1013     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_implementation.py
1014     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator.py
1015     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator_templates.py
1016     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/__init__.py
1017     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/models.py
1018 )
1019
1020 set(JavaScriptCore_INSPECTOR_DOMAINS
1021     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ApplicationCache.json
1022     ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json
1023     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
1024     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOM.json
1025     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMDebugger.json
1026     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMStorage.json
1027     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Database.json
1028     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Debugger.json
1029     ${JAVASCRIPTCORE_DIR}/inspector/protocol/GenericTypes.json
1030     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Inspector.json
1031     ${JAVASCRIPTCORE_DIR}/inspector/protocol/LayerTree.json
1032     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Network.json
1033     ${JAVASCRIPTCORE_DIR}/inspector/protocol/OverlayTypes.json
1034     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Page.json
1035     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Runtime.json
1036     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Timeline.json
1037     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Worker.json
1038 )
1039
1040 if (ENABLE_INDEXED_DATABASE)
1041     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1042         ${JAVASCRIPTCORE_DIR}/inspector/protocol/IndexedDB.json
1043     )
1044 endif ()
1045
1046 if (ENABLE_WEB_REPLAY)
1047     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1048         ${JAVASCRIPTCORE_DIR}/inspector/protocol/Replay.json
1049     )
1050 endif ()
1051
1052 add_custom_command(
1053     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1054     MAIN_DEPENDENCY ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py
1055     DEPENDS ${JavaScriptCore_INSPECTOR_DOMAINS}
1056     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py ${JavaScriptCore_INSPECTOR_DOMAINS} > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1057     VERBATIM)
1058
1059 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
1060 add_custom_command(
1061     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
1062            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1063            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.cpp
1064            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1065            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.cpp
1066            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1067            ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
1068     MAIN_DEPENDENCY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1069     DEPENDS ${JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS}
1070     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
1071     VERBATIM)
1072 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
1073
1074 # JSCBuiltins
1075 file(GLOB JSCBuiltins_js_files "${CMAKE_CURRENT_SOURCE_DIR}/builtins/*.js")
1076 add_custom_command(
1077    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1078    MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/generate-js-builtins
1079    DEPENDS ${JSCBuiltins_js_files}
1080    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
1081    VERBATIM)
1082
1083 list(APPEND JavaScriptCore_SOURCES
1084     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
1085     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.cpp
1086     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.cpp
1087     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp
1088 )
1089
1090 list(APPEND JavaScriptCore_HEADERS
1091     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1092     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1093     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1094     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1095 )
1096
1097 add_custom_command(
1098     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1099     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js
1100     DEPENDS ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py
1101     COMMAND echo "//# sourceURL=__WebInspectorInjectedScript__" > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1102     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py < ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js >> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1103     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h
1104     VERBATIM)
1105
1106 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h)
1107
1108 # Web Replay inputs generator
1109 if (ENABLE_WEB_REPLAY)
1110     set(JavaScript_WEB_REPLAY_INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/replay/JSInputs.json)
1111     add_custom_command(
1112         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.cpp
1113         MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/replay/scripts/CodeGeneratorReplayInputs.py
1114         DEPENDS ${JavaScript_WEB_REPLAY_INPUTS}
1115         COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/replay/scripts/CodeGeneratorReplayInputs.py --outputDir ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ --framework JavaScriptCore ${JavaScript_WEB_REPLAY_INPUTS}
1116         VERBATIM)
1117
1118     list(APPEND JavaScriptCore_SOURCES
1119         replay/EncodedValue.cpp
1120         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.cpp
1121     )
1122     list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h)
1123 endif ()
1124
1125 if (WTF_CPU_ARM)
1126     list(APPEND JavaScriptCore_SOURCES
1127         assembler/ARMAssembler.cpp
1128         assembler/ARMv7Assembler.cpp
1129         assembler/MacroAssemblerARM.cpp
1130     )
1131     if (MSVC AND ENABLE_JIT)
1132         add_custom_command(
1133             OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
1134             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_jit_stubs
1135             DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubsARM.h
1136             DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubs.cpp
1137             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
1138             VERBATIM)
1139
1140         add_custom_command(
1141             OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj
1142             MAIN_DEPENDENCY ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
1143             COMMAND armasm -nologo ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj
1144             VERBATIM)
1145
1146         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj)
1147     endif ()
1148 elseif (WTF_CPU_ARM64)
1149 elseif (WTF_CPU_PPC)
1150 elseif (WTF_CPU_PPC64)
1151 elseif (WTF_CPU_PPC64LE)
1152 elseif (WTF_CPU_S390)
1153 elseif (WTF_CPU_S390X)
1154 elseif (WTF_CPU_MIPS)
1155 elseif (WTF_CPU_SH4)
1156 elseif (WTF_CPU_X86)
1157 elseif (WTF_CPU_X86_64)
1158     if (MSVC AND ENABLE_JIT)
1159         add_custom_command(
1160             OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
1161             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1162             COMMAND ml64 -nologo -c -Fo ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1163             VERBATIM)
1164
1165         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj)
1166     endif ()
1167 else ()
1168     message(FATAL_ERROR "Unknown CPU")
1169 endif ()
1170
1171
1172 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
1173
1174 WEBKIT_CREATE_FORWARDING_HEADERS(JavaScriptCore DIRECTORIES ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES} FILES ${JavaScriptCore_FORWARDING_HEADERS_FILES})
1175
1176
1177 add_subdirectory(shell)
1178
1179 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
1180 include_directories(${JavaScriptCore_INCLUDE_DIRECTORIES})
1181 add_library(JavaScriptCore ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
1182 target_link_libraries(JavaScriptCore ${JavaScriptCore_LIBRARIES})
1183 set_target_properties(JavaScriptCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_JavaScriptCore")
1184 set_target_properties(JavaScriptCore PROPERTIES FOLDER "JavaScriptCore")
1185
1186 if (JavaScriptCore_OUTPUT_NAME)
1187     set_target_properties(JavaScriptCore PROPERTIES OUTPUT_NAME ${JavaScriptCore_OUTPUT_NAME})
1188 endif ()
1189
1190 if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
1191     POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE)
1192     set_target_properties(JavaScriptCore PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR})
1193     install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}")
1194 endif ()
1195
1196 if (ENABLE_FTL_JIT)
1197     add_dependencies(JavaScriptCore llvmForJSC)
1198 endif ()