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