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