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