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