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