Get rid of JSNameScope::m_type
[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/CallLinkInfo.cpp
70     bytecode/CallLinkStatus.cpp
71     bytecode/CallVariant.cpp
72     bytecode/CodeBlock.cpp
73     bytecode/CodeBlockHash.cpp
74     bytecode/CodeBlockJettisoningWatchpoint.cpp
75     bytecode/CodeOrigin.cpp
76     bytecode/CodeType.cpp
77     bytecode/ComplexGetStatus.cpp
78     bytecode/ConstantStructureCheck.cpp
79     bytecode/DFGExitProfile.cpp
80     bytecode/DeferredCompilationCallback.cpp
81     bytecode/ExecutionCounter.cpp
82     bytecode/ExitKind.cpp
83     bytecode/ExitingJITType.cpp
84     bytecode/GetByIdStatus.cpp
85     bytecode/GetByIdVariant.cpp
86     bytecode/InlineCallFrameSet.cpp
87     bytecode/JumpTable.cpp
88     bytecode/LazyOperandValueProfile.cpp
89     bytecode/MethodOfGettingAValueProfile.cpp
90     bytecode/Opcode.cpp
91     bytecode/PolymorphicGetByIdList.cpp
92     bytecode/PolymorphicPutByIdList.cpp
93     bytecode/PreciseJumpTargets.cpp
94     bytecode/PutByIdStatus.cpp
95     bytecode/PutByIdVariant.cpp
96     bytecode/ReduceWhitespace.cpp
97     bytecode/SamplingTool.cpp
98     bytecode/SpecialPointer.cpp
99     bytecode/SpeculatedType.cpp
100     bytecode/StructureSet.cpp
101     bytecode/StructureStubClearingWatchpoint.cpp
102     bytecode/StructureStubInfo.cpp
103     bytecode/ToThisStatus.cpp
104     bytecode/UnlinkedCodeBlock.cpp
105     bytecode/UnlinkedInstructionStream.cpp
106     bytecode/ValueRecovery.cpp
107     bytecode/VariableWatchpointSet.cpp
108     bytecode/VirtualRegister.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/ExecutableAllocator.cpp
331     jit/ExecutableAllocatorFixedVMPool.cpp
332     jit/GCAwareJITStubRoutine.cpp
333     jit/HostCallReturnValue.cpp
334     jit/JIT.cpp
335     jit/JITArithmetic.cpp
336     jit/JITArithmetic32_64.cpp
337     jit/JITCall.cpp
338     jit/JITCall32_64.cpp
339     jit/JITCode.cpp
340     jit/JITDisassembler.cpp
341     jit/JITExceptions.cpp
342     jit/JITInlineCacheGenerator.cpp
343     jit/JITOpcodes.cpp
344     jit/JITOpcodes32_64.cpp
345     jit/JITOperations.cpp
346     jit/JITPropertyAccess.cpp
347     jit/JITPropertyAccess32_64.cpp
348     jit/JITStubRoutine.cpp
349     jit/JITStubs.cpp
350     jit/JITThunks.cpp
351     jit/JITToDFGDeferredCompilationCallback.cpp
352     jit/SetupVarargsFrame.cpp
353     jit/PolymorphicCallStubRoutine.cpp
354     jit/Reg.cpp
355     jit/RegisterPreservationWrapperGenerator.cpp
356     jit/RegisterSet.cpp
357     jit/Repatch.cpp
358     jit/ScratchRegisterAllocator.cpp
359     jit/TempRegisterSet.cpp
360     jit/ThunkGenerators.cpp
361
362     parser/Lexer.cpp
363     parser/Nodes.cpp
364     parser/Parser.cpp
365     parser/ParserArena.cpp
366     parser/SourceCode.cpp
367     parser/SourceProvider.cpp
368     parser/SourceProviderCache.cpp
369
370     profiler/LegacyProfiler.cpp
371     profiler/Profile.cpp
372     profiler/ProfileGenerator.cpp
373     profiler/ProfileNode.cpp
374     profiler/ProfilerBytecode.cpp
375     profiler/ProfilerBytecodeSequence.cpp
376     profiler/ProfilerBytecodes.cpp
377     profiler/ProfilerCompilation.cpp
378     profiler/ProfilerCompilationKind.cpp
379     profiler/ProfilerCompiledBytecode.cpp
380     profiler/ProfilerDatabase.cpp
381     profiler/ProfilerJettisonReason.cpp
382     profiler/ProfilerOSRExit.cpp
383     profiler/ProfilerOSRExitSite.cpp
384     profiler/ProfilerOrigin.cpp
385     profiler/ProfilerOriginStack.cpp
386     profiler/ProfilerProfiledBytecodes.cpp
387
388     tools/CodeProfile.cpp
389     tools/CodeProfiling.cpp
390
391     yarr/RegularExpression.cpp
392     yarr/YarrCanonicalizeUCS2.cpp
393     yarr/YarrInterpreter.cpp
394     yarr/YarrJIT.cpp
395     yarr/YarrPattern.cpp
396     yarr/YarrSyntaxChecker.cpp
397 )
398
399 set(JavaScriptCore_RUNTIME_SOURCES
400     runtime/ArgList.cpp
401     runtime/Arguments.cpp
402     runtime/ArgumentsIteratorConstructor.cpp
403     runtime/ArgumentsIteratorPrototype.cpp
404     runtime/ArrayBuffer.cpp
405     runtime/ArrayBufferNeuteringWatchpoint.cpp
406     runtime/ArrayBufferView.cpp
407     runtime/ArrayConstructor.cpp
408     runtime/ArrayIteratorConstructor.cpp
409     runtime/ArrayIteratorPrototype.cpp
410     runtime/ArrayPrototype.cpp
411     runtime/BasicBlockLocation.cpp
412     runtime/BooleanConstructor.cpp
413     runtime/BooleanObject.cpp
414     runtime/BooleanPrototype.cpp
415     runtime/BundlePath.cpp
416     runtime/CallData.cpp
417     runtime/CodeCache.cpp
418     runtime/CodeSpecializationKind.cpp
419     runtime/CommonIdentifiers.cpp
420     runtime/CommonSlowPaths.cpp
421     runtime/CommonSlowPathsExceptions.cpp
422     runtime/CompilationResult.cpp
423     runtime/Completion.cpp
424     runtime/ConsoleClient.cpp
425     runtime/ConsolePrototype.cpp
426     runtime/ConstructData.cpp
427     runtime/ControlFlowProfiler.cpp
428     runtime/CustomGetterSetter.cpp
429     runtime/DataView.cpp
430     runtime/DateConstructor.cpp
431     runtime/DateConversion.cpp
432     runtime/DateInstance.cpp
433     runtime/DatePrototype.cpp
434     runtime/DumpContext.cpp
435     runtime/Error.cpp
436     runtime/ErrorConstructor.cpp
437     runtime/ErrorHandlingScope.cpp
438     runtime/ErrorInstance.cpp
439     runtime/ErrorPrototype.cpp
440     runtime/ExceptionFuzz.cpp
441     runtime/ExceptionHelpers.cpp 
442     runtime/Executable.cpp
443     runtime/FunctionConstructor.cpp
444     runtime/FunctionExecutableDump.cpp
445     runtime/FunctionHasExecutedCache.cpp
446     runtime/FunctionPrototype.cpp
447     runtime/GetterSetter.cpp
448     runtime/Identifier.cpp
449     runtime/IndexingType.cpp
450     runtime/InitializeThreading.cpp
451     runtime/IntendedStructureChain.cpp
452     runtime/InternalFunction.cpp
453     runtime/JSAPIValueWrapper.cpp
454     runtime/JSLexicalEnvironment.cpp
455     runtime/JSArgumentsIterator.cpp
456     runtime/JSArray.cpp
457     runtime/JSArrayBuffer.cpp
458     runtime/JSArrayBufferConstructor.cpp
459     runtime/JSArrayBufferPrototype.cpp
460     runtime/JSArrayBufferView.cpp
461     runtime/JSArrayIterator.cpp
462     runtime/JSBoundFunction.cpp
463     runtime/JSGlobalObjectDebuggable.cpp
464     runtime/JSCJSValue.cpp
465     runtime/JSCallee.cpp
466     runtime/JSCatchScope.cpp
467     runtime/JSCell.cpp
468     runtime/JSConsole.cpp
469     runtime/JSDataView.cpp
470     runtime/JSDataViewPrototype.cpp
471     runtime/JSDateMath.cpp
472     runtime/JSEnvironmentRecord.cpp
473     runtime/JSFunction.cpp
474     runtime/JSFunctionNameScope.cpp
475     runtime/JSGlobalObject.cpp
476     runtime/JSGlobalObjectFunctions.cpp
477     runtime/JSLock.cpp
478     runtime/JSMap.cpp
479     runtime/JSMapIterator.cpp
480     runtime/JSNameScope.cpp
481     runtime/JSNotAnObject.cpp
482     runtime/JSONObject.cpp
483     runtime/JSObject.cpp
484     runtime/JSPromise.cpp
485     runtime/JSPromiseConstructor.cpp
486     runtime/JSPromiseDeferred.cpp
487     runtime/JSPromiseFunctions.cpp
488     runtime/JSPromiseReaction.cpp
489     runtime/JSPromisePrototype.cpp
490     runtime/JSProxy.cpp
491     runtime/JSPropertyNameEnumerator.cpp
492     runtime/JSScope.cpp
493     runtime/JSSegmentedVariableObject.cpp
494     runtime/JSSet.cpp
495     runtime/JSSetIterator.cpp
496     runtime/JSString.cpp
497     runtime/JSStringJoiner.cpp
498     runtime/JSSymbolTableObject.cpp
499     runtime/JSTypedArrayConstructors.cpp
500     runtime/JSTypedArrayPrototypes.cpp
501     runtime/JSTypedArrays.cpp
502     runtime/JSWeakMap.cpp
503     runtime/JSWithScope.cpp
504     runtime/JSWrapperObject.cpp
505     runtime/LiteralParser.cpp
506     runtime/Lookup.cpp
507     runtime/MapConstructor.cpp
508     runtime/MapData.cpp
509     runtime/MapIteratorConstructor.cpp
510     runtime/MapIteratorPrototype.cpp
511     runtime/MapPrototype.cpp
512     runtime/MathCommon.cpp
513     runtime/MathObject.cpp
514     runtime/MemoryStatistics.cpp
515     runtime/NativeErrorConstructor.cpp
516     runtime/NativeErrorPrototype.cpp
517     runtime/NullGetterFunction.cpp
518     runtime/NullSetterFunction.cpp
519     runtime/NumberConstructor.cpp
520     runtime/NumberObject.cpp
521     runtime/NumberPrototype.cpp
522     runtime/ObjectConstructor.cpp
523     runtime/ObjectPrototype.cpp
524     runtime/Operations.cpp
525     runtime/Options.cpp
526     runtime/PropertyDescriptor.cpp
527     runtime/PropertyNameArray.cpp
528     runtime/PropertySlot.cpp
529     runtime/PropertyTable.cpp
530     runtime/PrototypeMap.cpp
531     runtime/RegExp.cpp
532     runtime/RegExpCache.cpp
533     runtime/RegExpCachedResult.cpp
534     runtime/RegExpConstructor.cpp
535     runtime/RegExpMatchesArray.cpp
536     runtime/RegExpObject.cpp
537     runtime/RegExpPrototype.cpp
538     runtime/SamplingCounter.cpp
539     runtime/SetConstructor.cpp
540     runtime/SetIteratorConstructor.cpp
541     runtime/SetIteratorPrototype.cpp
542     runtime/SetPrototype.cpp
543     runtime/SimpleTypedArrayController.cpp
544     runtime/SmallStrings.cpp
545     runtime/SparseArrayValueMap.cpp
546     runtime/StrictEvalActivation.cpp
547     runtime/StringConstructor.cpp
548     runtime/StringObject.cpp
549     runtime/StringPrototype.cpp
550     runtime/StringRecursionChecker.cpp
551     runtime/Structure.cpp
552     runtime/StructureChain.cpp
553     runtime/StructureIDTable.cpp
554     runtime/StructureRareData.cpp
555     runtime/Symbol.cpp
556     runtime/SymbolObject.cpp
557     runtime/SymbolPrototype.cpp
558     runtime/SymbolConstructor.cpp
559     runtime/SymbolTable.cpp
560     runtime/TestRunnerUtils.cpp
561     runtime/TypeLocationCache.cpp
562     runtime/TypeProfiler.cpp
563     runtime/TypeProfilerLog.cpp
564     runtime/TypeSet.cpp
565     runtime/TypedArrayController.cpp
566     runtime/TypedArrayType.cpp
567     runtime/VM.cpp
568     runtime/VMEntryScope.cpp
569     runtime/Watchdog.cpp
570     runtime/WatchdogNone.cpp
571     runtime/WeakMapConstructor.cpp
572     runtime/WeakMapData.cpp
573     runtime/WeakMapPrototype.cpp
574 )
575
576 list(APPEND JavaScriptCore_SOURCES
577     ${JavaScriptCore_RUNTIME_SOURCES}
578 )
579
580 set(JavaScriptCore_LUT_FILES
581     runtime/ArrayConstructor.cpp
582     runtime/ArrayPrototype.cpp
583     runtime/BooleanPrototype.cpp
584     runtime/DateConstructor.cpp
585     runtime/DatePrototype.cpp
586     runtime/ErrorPrototype.cpp
587     runtime/JSDataViewPrototype.cpp
588     runtime/JSGlobalObject.cpp
589     runtime/JSONObject.cpp
590     runtime/JSPromiseConstructor.cpp
591     runtime/JSPromisePrototype.cpp
592     runtime/NumberConstructor.cpp
593     runtime/NumberPrototype.cpp
594     runtime/ObjectConstructor.cpp
595     runtime/RegExpConstructor.cpp
596     runtime/RegExpObject.cpp
597     runtime/RegExpPrototype.cpp
598     runtime/StringConstructor.cpp
599     runtime/SymbolPrototype.cpp
600 )
601
602 set(JavaScriptCore_LIBRARIES
603     WTF
604     ${ICU_I18N_LIBRARIES}
605 )
606
607 if (WTF_USE_UDIS86)
608     set(UDIS_GEN_DEP
609         disassembler/udis86/ud_opcode.py
610         disassembler/udis86/ud_optable.py
611     )
612
613     add_custom_command(
614         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.c ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
615         DEPENDS ${UDIS_GEN_DEP}
616         WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
617         COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/disassembler/udis86/itab.py ${JAVASCRIPTCORE_DIR}/disassembler/udis86/optable.xml
618         VERBATIM)
619
620     list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
621         ${JAVASCRIPTCORE_DIR}/disassembler/udis86
622     )
623     list(APPEND JavaScriptCore_HEADERS
624         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
625     )
626     list(APPEND JavaScriptCore_SOURCES
627         disassembler/udis86/udis86.c
628         disassembler/udis86/udis86_decode.c
629         disassembler/udis86/udis86_input.c
630         disassembler/udis86/udis86_itab_holder.c
631         disassembler/udis86/udis86_syn-att.c
632         disassembler/udis86/udis86_syn-intel.c
633         disassembler/udis86/udis86_syn.c
634         disassembler/UDis86Disassembler.cpp
635     )
636 endif ()
637
638 # We cannot check for RUBY_FOUND because it is set only when the full package is installed and
639 # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
640 # for finding the only Ruby interpreter.
641 if (NOT RUBY_EXECUTABLE)
642     message(FATAL_ERROR "The Ruby interpreter is needed to generate LLInt files.")
643 endif ()
644
645 set(LLINT_ASM
646     llint/LowLevelInterpreter.asm
647     llint/LowLevelInterpreter32_64.asm
648     llint/LowLevelInterpreter64.asm
649 )
650
651 set(OFFLINE_ASM
652     offlineasm/arm.rb
653     offlineasm/arm64.rb
654     offlineasm/ast.rb
655     offlineasm/backends.rb
656     offlineasm/cloop.rb
657     offlineasm/config.rb
658     offlineasm/instructions.rb
659     offlineasm/mips.rb
660     offlineasm/offsets.rb
661     offlineasm/opt.rb
662     offlineasm/parser.rb
663     offlineasm/registers.rb
664     offlineasm/risc.rb
665     offlineasm/self_hash.rb
666     offlineasm/settings.rb
667     offlineasm/sh4.rb
668     offlineasm/transform.rb
669     offlineasm/x86.rb
670 )
671
672 add_custom_command(
673     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
674     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/generate-bytecode-files
675     DEPENDS ${JAVASCRIPTCORE_DIR}/generate-bytecode-files bytecode/BytecodeList.json
676     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
677     VERBATIM)
678
679 add_custom_command(
680     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
681     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
682     DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
683     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
684     VERBATIM)
685
686 # We add the header files directly to the ADD_EXECUTABLE call instead of setting the
687 # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb and
688 # generate-bytecode-files may not regenerate the .h files in case the hash it calculates does not change.
689 # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMANDs above have
690 # changed the command will always be called because the mtime of the .h files will
691 # always be older than that of their dependencies.
692 # Additionally, setting the OBJECT_DEPENDS property will make the .h files a Makefile
693 # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
694 # actually be run multiple times!
695 add_executable(LLIntOffsetsExtractor
696     ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
697     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
698 )
699 target_link_libraries(LLIntOffsetsExtractor WTF)
700
701 # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
702 # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
703 # that generates a checksum of the LLIntOffsetsExtractor binary, if the checksum of the new
704 # LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid
705 # running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch)
706 # after every asm.rb run.
707 if (MSVC)
708     set(LLIntOutput LowLevelInterpreterWin.asm)
709 else ()
710     set(LLIntOutput LLIntAssembly.h)
711 endif ()
712
713 add_custom_command(
714     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
715     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb
716     DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
717     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}
718     COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${LLIntOutput}
719     VERBATIM)
720
721 # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
722 # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
723 # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
724 # since it is used in the add_library() call at the end of this file.
725 if (MSVC)
726     list(APPEND JavaScriptCore_SOURCES
727         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
728     )
729     # Win32 needs /safeseh with assembly, but Win64 does not.
730     if (CMAKE_SIZEOF_VOID_P EQUAL 4)
731         set_source_files_properties(${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
732             PROPERTIES COMPILE_FLAGS  "/safeseh"
733         )
734     endif ()
735 else ()
736     list(APPEND JavaScriptCore_HEADERS
737         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
738     )
739 endif ()
740
741 list(APPEND JavaScriptCore_SOURCES
742     llint/LLIntCLoop.cpp
743     llint/LLIntData.cpp
744     llint/LLIntEntrypoint.cpp
745     llint/LLIntExceptions.cpp
746     llint/LLIntSlowPaths.cpp
747     llint/LLIntThunks.cpp
748     llint/LowLevelInterpreter.cpp
749 )
750
751
752 if (ENABLE_FTL_JIT)
753     if (NOT LLVM_STATIC_LIBRARIES)
754         message(FATAL_ERROR "No LLVM libs found, but FTL is enabled. Stopping build.")
755     endif ()
756
757     # Configure llvmForJSC.so
758     set(llvmForJSC_SOURCES
759         llvm/library/LLVMAnchor.cpp
760         llvm/library/LLVMExports.cpp
761         llvm/library/LLVMOverrides.cpp
762     )
763     set(llvmForJSC_INCLUDE_DIRECTORIES
764         ${LLVM_INCLUDE_DIRS}
765         "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
766     )
767
768     add_custom_command(
769         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h
770         DEPENDS ${LLVM_STATIC_LIBRARIES}
771         COMMAND ${CMAKE_COMMAND} -E touch ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h
772         VERBATIM)
773
774     if (ENABLE_FTL_NATIVE_CALL_INLINING)
775         function(JOIN VALUES GLUE OUTPUT)
776             string(REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
777             set(${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
778         endfunction()
779
780         JOIN("${JavaScriptCore_INCLUDE_DIRECTORIES}" " -I" JSC_INCLUDES)
781
782         set(LLVM_BITCODE_FILES)
783
784         foreach (_file ${JavaScriptCore_RUNTIME_SOURCES})
785             get_filename_component(_name ${_file} NAME_WE)
786             add_custom_command(
787                 OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/${_name}.bc
788                 COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create-llvm-ir-from-source-file.py ${_file} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CLANG_EXE} "${JSC_INCLUDES}"
789                 WORKING_DIRECTORY "${JAVASCRIPTCORE_DIR}"
790                 VERBATIM)
791
792             ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/ftl/FTLState.cpp ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/${_name}.bc)
793             list(APPEND LLVM_BITCODE_FILES
794                 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/runtime/${_name}.bc
795             )
796         endforeach ()
797
798         get_filename_component(LLVM_BINS ${LLVM_CONFIG_EXE} PATH)
799
800         add_custom_command(
801             OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InlineRuntimeSymbolTable.h
802             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create-symbol-table-index.py
803             DEPENDS ${LLVM_BITCODE_FILES}
804             COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create-symbol-table-index.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${JAVASCRIPTCORE_DIR} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} ${LLVM_BINS}
805             WORKING_DIRECTORY "${JAVASCRIPTCORE_DIR}"
806             VERBATIM)
807
808         ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/ftl/FTLState.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InlineRuntimeSymbolTable.h)
809     endif ()
810
811     WEBKIT_WRAP_SOURCELIST(${llvmForJSC_SOURCES})
812     add_library(llvmForJSC SHARED ${llvmForJSC_SOURCES} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h)
813     target_link_libraries(llvmForJSC ${LLVM_STATIC_LIBRARIES} "pthread" "dl")
814
815     # Added extra items for JavaScriptCore
816     list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
817         ${LLVM_INCLUDE_DIRS}
818     )
819
820     list(APPEND JavaScriptCore_SOURCES
821         dfg/DFGToFTLDeferredCompilationCallback.cpp
822         dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp
823
824         disassembler/LLVMDisassembler.cpp
825         disassembler/X86Disassembler.cpp
826
827         ftl/FTLAbstractHeap.cpp
828         ftl/FTLAbstractHeapRepository.cpp
829         ftl/FTLAvailableRecovery.cpp
830         ftl/FTLCapabilities.cpp
831         ftl/FTLCommonValues.cpp
832         ftl/FTLCompile.cpp
833         ftl/FTLDWARFDebugLineInfo.cpp
834         ftl/FTLDWARFRegister.cpp
835         ftl/FTLDataSection.cpp
836         ftl/FTLExitArgument.cpp
837         ftl/FTLExitArgumentForOperand.cpp
838         ftl/FTLExitPropertyValue.cpp
839         ftl/FTLExitThunkGenerator.cpp
840         ftl/FTLExitTimeObjectMaterialization.cpp
841         ftl/FTLExitValue.cpp
842         ftl/FTLFail.cpp
843         ftl/FTLForOSREntryJITCode.cpp
844         ftl/FTLInlineCacheSize.cpp
845         ftl/FTLIntrinsicRepository.cpp
846         ftl/FTLJITCode.cpp
847         ftl/FTLJITFinalizer.cpp
848         ftl/FTLJSCall.cpp
849         ftl/FTLJSCallBase.cpp
850         ftl/FTLJSCallVarargs.cpp
851         ftl/FTLLink.cpp
852         ftl/FTLLocation.cpp
853         ftl/FTLLowerDFGToLLVM.cpp
854         ftl/FTLOSREntry.cpp
855         ftl/FTLOSRExitCompiler.cpp
856         ftl/FTLOSRExit.cpp
857         ftl/FTLOperations.cpp
858         ftl/FTLOutput.cpp
859         ftl/FTLRecoveryOpcode.cpp
860         ftl/FTLRegisterAtOffset.cpp
861         ftl/FTLSaveRestore.cpp
862         ftl/FTLSlowPathCall.cpp
863         ftl/FTLSlowPathCallKey.cpp
864         ftl/FTLStackMaps.cpp
865         ftl/FTLState.cpp
866         ftl/FTLThunks.cpp
867         ftl/FTLUnwindInfo.cpp
868         ftl/FTLValueFormat.cpp
869         ftl/FTLValueRange.cpp
870
871         llvm/InitializeLLVM.cpp
872         llvm/InitializeLLVMLinux.cpp
873         llvm/InitializeLLVMPOSIX.cpp
874         llvm/LLVMAPI.cpp
875     )
876 endif ()
877
878 set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
879 macro(GENERATE_HASH_LUT _input _output)
880     add_custom_command(
881         OUTPUT ${_output}
882         DEPENDS ${HASH_LUT_GENERATOR} ${_input} ${CMAKE_CURRENT_SOURCE_DIR}/generate-js-builtins
883         COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} -i > ${_output}
884         VERBATIM)
885     list(APPEND JavaScriptCore_HEADERS ${_output})
886 endmacro()
887
888 # GENERATOR 1-A: LUT creator
889 foreach (_file ${JavaScriptCore_LUT_FILES})
890     get_filename_component(_name ${_file} NAME_WE)
891     GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
892 endforeach ()
893
894 set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES
895     assembler
896     bindings
897     bytecode
898     debugger
899     heap
900     inspector
901     inspector/agents
902     inspector/remote
903     interpreter
904     jit
905     llint
906     parser
907     profiler
908     runtime
909     yarr
910
911     collector/handles
912     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
913 )
914
915 set(JavaScriptCore_FORWARDING_HEADERS_FILES
916     API/APICallbackFunction.h
917     API/APICast.h
918     API/JSAPIWrapperObject.h
919     API/JSBase.h
920     API/JSBasePrivate.h
921     API/JSCTestRunnerUtils.h
922     API/JSCallbackConstructor.h
923     API/JSCallbackFunction.h
924     API/JSCallbackObject.h
925     API/JSCallbackObjectFunctions.h
926     API/JSClassRef.h
927     API/JSContext.h
928     API/JSContextInternal.h
929     API/JSContextPrivate.h
930     API/JSContextRef.h
931     API/JSContextRefInternal.h
932     API/JSContextRefPrivate.h
933     API/JSExport.h
934     API/JSManagedValue.h
935     API/JSManagedValueInternal.h
936     API/JSObjectRef.h
937     API/JSObjectRefPrivate.h
938     API/JSProfilerPrivate.h
939     API/JSRetainPtr.h
940     API/JSScriptRefPrivate.h
941     API/JSStringRef.h
942     API/JSStringRefBSTR.h
943     API/JSStringRefCF.h
944     API/JSStringRefPrivate.h
945     API/JSValue.h
946     API/JSValueInternal.h
947     API/JSValueRef.h
948     API/JSVirtualMachine.h
949     API/JSVirtualMachineInternal.h
950     API/JSWeakObjectMapRefInternal.h
951     API/JSWeakObjectMapRefPrivate.h
952     API/JSWrapperMap.h
953     API/JavaScript.h
954     API/JavaScriptCore.h
955     API/ObjcRuntimeExtras.h
956     API/OpaqueJSString.h
957     API/WebKitAvailability.h
958
959     assembler/LinkBuffer.h
960     assembler/MacroAssembler.h
961     assembler/MacroAssemblerCodeRef.h
962     assembler/MacroAssemblerCodeRef.h
963
964     inspector/remote/RemoteInspector.h
965     inspector/remote/RemoteInspectorConstants.h
966     inspector/remote/RemoteInspectorDebuggable.h
967     inspector/remote/RemoteInspectorDebuggableConnection.h
968     inspector/remote/RemoteInspectorXPCConnection.h
969
970     jit/GPRInfo.h
971
972     runtime/VM.h
973
974     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
975     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h
976     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
977 )
978
979
980 # GENERATOR 1-B: particular LUT creator (for 1 file only)
981 GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
982
983 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
984 add_custom_command(
985     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
986     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables
987     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
988     VERBATIM)
989 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
990
991
992 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
993 add_custom_command(
994     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
995     MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
996     COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
997     VERBATIM)
998 ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
999
1000
1001 # Inspector Interfaces
1002
1003 set(JavaScriptCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
1004
1005 set(JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS
1006     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
1007     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator.py
1008     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator_templates.py
1009     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_js_backend_commands.py
1010     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_header.py
1011     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_implementation.py
1012     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_header.py
1013     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_implementation.py
1014     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_header.py
1015     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_implementation.py
1016     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator.py
1017     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator_templates.py
1018     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/__init__.py
1019     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/models.py
1020 )
1021
1022 set(JavaScriptCore_INSPECTOR_DOMAINS
1023     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ApplicationCache.json
1024     ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json
1025     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
1026     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOM.json
1027     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMDebugger.json
1028     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMStorage.json
1029     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Database.json
1030     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Debugger.json
1031     ${JAVASCRIPTCORE_DIR}/inspector/protocol/GenericTypes.json
1032     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Inspector.json
1033     ${JAVASCRIPTCORE_DIR}/inspector/protocol/LayerTree.json
1034     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Network.json
1035     ${JAVASCRIPTCORE_DIR}/inspector/protocol/OverlayTypes.json
1036     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Page.json
1037     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Runtime.json
1038     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Timeline.json
1039     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Worker.json
1040 )
1041
1042 if (ENABLE_INDEXED_DATABASE)
1043     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1044         ${JAVASCRIPTCORE_DIR}/inspector/protocol/IndexedDB.json
1045     )
1046 endif ()
1047
1048 if (ENABLE_WEB_REPLAY)
1049     list(APPEND JavaScriptCore_INSPECTOR_DOMAINS
1050         ${JAVASCRIPTCORE_DIR}/inspector/protocol/Replay.json
1051     )
1052 endif ()
1053
1054 add_custom_command(
1055     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1056     MAIN_DEPENDENCY ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py
1057     DEPENDS ${JavaScriptCore_INSPECTOR_DOMAINS}
1058     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py ${JavaScriptCore_INSPECTOR_DOMAINS} > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1059     VERBATIM)
1060
1061 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
1062 add_custom_command(
1063     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
1064            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1065            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.cpp
1066            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1067            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.cpp
1068            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1069            ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
1070     MAIN_DEPENDENCY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/CombinedDomains.json
1071     DEPENDS ${JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS}
1072     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
1073     VERBATIM)
1074 file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
1075
1076 # JSCBuiltins
1077 file(GLOB JSCBuiltins_js_files "${CMAKE_CURRENT_SOURCE_DIR}/builtins/*.js")
1078 add_custom_command(
1079    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1080    MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/generate-js-builtins
1081    DEPENDS ${JSCBuiltins_js_files}
1082    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
1083    VERBATIM)
1084
1085 list(APPEND JavaScriptCore_SOURCES
1086     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.cpp
1087     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.cpp
1088     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.cpp
1089     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp
1090 )
1091
1092 list(APPEND JavaScriptCore_HEADERS
1093     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendDispatchers.h
1094     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorFrontendDispatchers.h
1095     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorProtocolObjects.h
1096     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1097 )
1098
1099 add_custom_command(
1100     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1101     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js
1102     DEPENDS ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py
1103     COMMAND echo "//# sourceURL=__WebInspectorInjectedScript__" > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1104     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py < ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js >> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
1105     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h
1106     VERBATIM)
1107
1108 list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h)
1109
1110 # Web Replay inputs generator
1111 if (ENABLE_WEB_REPLAY)
1112     set(JavaScript_WEB_REPLAY_INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/replay/JSInputs.json)
1113     add_custom_command(
1114         OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.cpp
1115         MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/replay/scripts/CodeGeneratorReplayInputs.py
1116         DEPENDS ${JavaScript_WEB_REPLAY_INPUTS}
1117         COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/replay/scripts/CodeGeneratorReplayInputs.py --outputDir ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ --framework JavaScriptCore ${JavaScript_WEB_REPLAY_INPUTS}
1118         VERBATIM)
1119
1120     list(APPEND JavaScriptCore_SOURCES
1121         replay/EncodedValue.cpp
1122         ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.cpp
1123     )
1124     list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSReplayInputs.h)
1125 endif ()
1126
1127 if (WTF_CPU_ARM)
1128     list(APPEND JavaScriptCore_SOURCES
1129         assembler/ARMAssembler.cpp
1130         assembler/ARMv7Assembler.cpp
1131         assembler/MacroAssemblerARM.cpp
1132     )
1133     if (MSVC AND ENABLE_JIT)
1134         add_custom_command(
1135             OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
1136             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_jit_stubs
1137             DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubsARM.h
1138             DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubs.cpp
1139             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
1140             VERBATIM)
1141
1142         add_custom_command(
1143             OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj
1144             MAIN_DEPENDENCY ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm
1145             COMMAND armasm -nologo ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj
1146             VERBATIM)
1147
1148         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj)
1149     endif ()
1150 elseif (WTF_CPU_ARM64)
1151 elseif (WTF_CPU_PPC)
1152 elseif (WTF_CPU_PPC64)
1153 elseif (WTF_CPU_PPC64LE)
1154 elseif (WTF_CPU_S390)
1155 elseif (WTF_CPU_S390X)
1156 elseif (WTF_CPU_MIPS)
1157 elseif (WTF_CPU_SH4)
1158 elseif (WTF_CPU_X86)
1159 elseif (WTF_CPU_X86_64)
1160     if (MSVC AND ENABLE_JIT)
1161         add_custom_command(
1162             OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
1163             MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1164             COMMAND ml64 -nologo -c -Fo ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm
1165             VERBATIM)
1166
1167         list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj)
1168     endif ()
1169 else ()
1170     message(FATAL_ERROR "Unknown CPU")
1171 endif ()
1172
1173
1174 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
1175
1176 WEBKIT_CREATE_FORWARDING_HEADERS(JavaScriptCore DIRECTORIES ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES} FILES ${JavaScriptCore_FORWARDING_HEADERS_FILES})
1177
1178
1179 add_subdirectory(shell)
1180
1181 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
1182 include_directories(${JavaScriptCore_INCLUDE_DIRECTORIES})
1183 add_library(JavaScriptCore ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
1184 target_link_libraries(JavaScriptCore ${JavaScriptCore_LIBRARIES})
1185 set_target_properties(JavaScriptCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_JavaScriptCore")
1186 set_target_properties(JavaScriptCore PROPERTIES FOLDER "JavaScriptCore")
1187
1188 if (JavaScriptCore_OUTPUT_NAME)
1189     set_target_properties(JavaScriptCore PROPERTIES OUTPUT_NAME ${JavaScriptCore_OUTPUT_NAME})
1190 endif ()
1191
1192 if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED")
1193     POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE)
1194     set_target_properties(JavaScriptCore PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR})
1195     install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}")
1196 endif ()
1197
1198 if (ENABLE_FTL_JIT)
1199     add_dependencies(JavaScriptCore llvmForJSC)
1200 endif ()