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