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