Bug 1865597 - Add error checking when initializing parallel marking and disable on...
[gecko.git] / js / src / jit / moz.build
blob1656d7c2e2951c1df38159e041390f5da3a633f8
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 FINAL_LIBRARY = "js"
9 # Includes should be relative to parent path
10 LOCAL_INCLUDES += ["!..", ".."]
12 include("../js-config.mozbuild")
13 include("../js-cxxflags.mozbuild")
15 UNIFIED_SOURCES += [
16     "AliasAnalysis.cpp",
17     "AlignmentMaskAnalysis.cpp",
18     "BacktrackingAllocator.cpp",
19     "Bailouts.cpp",
20     "BaselineBailouts.cpp",
21     "BaselineCacheIRCompiler.cpp",
22     "BaselineCodeGen.cpp",
23     "BaselineDebugModeOSR.cpp",
24     "BaselineFrame.cpp",
25     "BaselineFrameInfo.cpp",
26     "BaselineIC.cpp",
27     "BaselineJIT.cpp",
28     "BitSet.cpp",
29     "BytecodeAnalysis.cpp",
30     "CacheIR.cpp",
31     "CacheIRCompiler.cpp",
32     "CacheIRHealth.cpp",
33     "CacheIRSpewer.cpp",
34     "CodeGenerator.cpp",
35     "CompileWrappers.cpp",
36     "Disassemble.cpp",
37     "EdgeCaseAnalysis.cpp",
38     "EffectiveAddressAnalysis.cpp",
39     "ExecutableAllocator.cpp",
40     "FlushICache.cpp",
41     "FoldLinearArithConstants.cpp",
42     "InlinableNatives.cpp",
43     "InstructionReordering.cpp",
44     "InterpreterEntryTrampoline.cpp",
45     "Ion.cpp",
46     "IonAnalysis.cpp",
47     "IonCacheIRCompiler.cpp",
48     "IonCompileTask.cpp",
49     "IonIC.cpp",
50     "IonOptimizationLevels.cpp",
51     "Jit.cpp",
52     "JitcodeMap.cpp",
53     "JitContext.cpp",
54     "JitFrames.cpp",
55     "JitHints.cpp",
56     "JitOptions.cpp",
57     "JitScript.cpp",
58     "JitSpewer.cpp",
59     "JSJitFrameIter.cpp",
60     "JSONSpewer.cpp",
61     "KnownClass.cpp",
62     "Label.cpp",
63     "LICM.cpp",
64     "Linker.cpp",
65     "LIR.cpp",
66     "Lowering.cpp",
67     "MacroAssembler.cpp",
68     "MIR.cpp",
69     "MIRGraph.cpp",
70     "MoveResolver.cpp",
71     "PerfSpewer.cpp",
72     "ProcessExecutableMemory.cpp",
73     "RangeAnalysis.cpp",
74     "ReciprocalMulConstants.cpp",
75     "Recover.cpp",
76     "RegisterAllocator.cpp",
77     "RematerializedFrame.cpp",
78     "SafepointIndex.cpp",
79     "Safepoints.cpp",
80     "ScalarReplacement.cpp",
81     "shared/Assembler-shared.cpp",
82     "shared/AtomicOperations-shared-jit.cpp",
83     "shared/CodeGenerator-shared.cpp",
84     "shared/Disassembler-shared.cpp",
85     "shared/Lowering-shared.cpp",
86     "ShuffleAnalysis.cpp",
87     "Sink.cpp",
88     "Snapshots.cpp",
89     "Trampoline.cpp",
90     "TrialInlining.cpp",
91     "TypePolicy.cpp",
92     "ValueNumbering.cpp",
93     "VMFunctions.cpp",
94     "WarpBuilder.cpp",
95     "WarpBuilderShared.cpp",
96     "WarpCacheIRTranspiler.cpp",
97     "WarpOracle.cpp",
98     "WarpSnapshot.cpp",
99     "WasmBCE.cpp",
100     "XrayJitInfo.cpp",
103 if CONFIG["JS_CODEGEN_NONE"]:
104     UNIFIED_SOURCES += ["none/Trampoline-none.cpp"]
105 elif CONFIG["JS_CODEGEN_X86"] or CONFIG["JS_CODEGEN_X64"]:
106     UNIFIED_SOURCES += [
107         "x86-shared/Architecture-x86-shared.cpp",
108         "x86-shared/Assembler-x86-shared.cpp",
109         "x86-shared/AssemblerBuffer-x86-shared.cpp",
110         "x86-shared/CodeGenerator-x86-shared.cpp",
111         "x86-shared/Lowering-x86-shared.cpp",
112         "x86-shared/MacroAssembler-x86-shared-SIMD.cpp",
113         "x86-shared/MacroAssembler-x86-shared.cpp",
114         "x86-shared/MoveEmitter-x86-shared.cpp",
115     ]
116     if CONFIG["JS_CODEGEN_X64"]:
117         UNIFIED_SOURCES += [
118             "x64/Assembler-x64.cpp",
119             "x64/CodeGenerator-x64.cpp",
120             "x64/Lowering-x64.cpp",
121             "x64/MacroAssembler-x64.cpp",
122             "x64/Trampoline-x64.cpp",
123         ]
124     else:
125         UNIFIED_SOURCES += [
126             "x86/Assembler-x86.cpp",
127             "x86/CodeGenerator-x86.cpp",
128             "x86/Lowering-x86.cpp",
129             "x86/MacroAssembler-x86.cpp",
130             "x86/Trampoline-x86.cpp",
131         ]
132 elif CONFIG["JS_CODEGEN_ARM"]:
133     UNIFIED_SOURCES += [
134         "arm/Architecture-arm.cpp",
135         "arm/Assembler-arm.cpp",
136         "arm/CodeGenerator-arm.cpp",
137         "arm/disasm/Constants-arm.cpp",
138         "arm/disasm/Disasm-arm.cpp",
139         "arm/Lowering-arm.cpp",
140         "arm/MacroAssembler-arm.cpp",
141         "arm/MoveEmitter-arm.cpp",
142         "arm/Trampoline-arm.cpp",
143     ]
144     if CONFIG["JS_SIMULATOR_ARM"]:
145         UNIFIED_SOURCES += ["arm/Simulator-arm.cpp"]
146     elif CONFIG["OS_ARCH"] == "Darwin":
147         SOURCES += [
148             "arm/llvm-compiler-rt/arm/aeabi_idivmod.S",
149             "arm/llvm-compiler-rt/arm/aeabi_uidivmod.S",
150         ]
151 elif CONFIG["JS_CODEGEN_ARM64"]:
152     UNIFIED_SOURCES += [
153         "arm64/Architecture-arm64.cpp",
154         "arm64/Assembler-arm64.cpp",
155         "arm64/CodeGenerator-arm64.cpp",
156         "arm64/Lowering-arm64.cpp",
157         "arm64/MacroAssembler-arm64.cpp",
158         "arm64/MoveEmitter-arm64.cpp",
159         "arm64/Trampoline-arm64.cpp",
160         "arm64/vixl/Assembler-vixl.cpp",
161         "arm64/vixl/Cpu-Features-vixl.cpp",
162         "arm64/vixl/Cpu-vixl.cpp",
163         "arm64/vixl/Decoder-vixl.cpp",
164         "arm64/vixl/Instructions-vixl.cpp",
165         "arm64/vixl/MacroAssembler-vixl.cpp",
166         "arm64/vixl/MozAssembler-vixl.cpp",
167         "arm64/vixl/MozCpu-vixl.cpp",
168         "arm64/vixl/MozInstructions-vixl.cpp",
169         "arm64/vixl/Utils-vixl.cpp",
170     ]
171     vixl_werror_sources = [
172         "arm64/vixl/Disasm-vixl.cpp",
173         "arm64/vixl/Instrument-vixl.cpp",
174     ]
175     SOURCES += vixl_werror_sources
176     if CONFIG["CC_TYPE"] == "clang-cl":
177         for f in vixl_werror_sources:
178             SOURCES[f].flags += ["-Wno-c++11-narrowing"]
179     if CONFIG["JS_SIMULATOR_ARM64"]:
180         UNIFIED_SOURCES += [
181             "arm64/vixl/Debugger-vixl.cpp",
182             "arm64/vixl/Logic-vixl.cpp",
183             "arm64/vixl/MozSimulator-vixl.cpp",
184             "arm64/vixl/Simulator-vixl.cpp",
185         ]
186 elif CONFIG["JS_CODEGEN_MIPS32"] or CONFIG["JS_CODEGEN_MIPS64"]:
187     UNIFIED_SOURCES += [
188         "mips-shared/Architecture-mips-shared.cpp",
189         "mips-shared/Assembler-mips-shared.cpp",
190         "mips-shared/CodeGenerator-mips-shared.cpp",
191         "mips-shared/Lowering-mips-shared.cpp",
192         "mips-shared/MacroAssembler-mips-shared.cpp",
193         "mips-shared/MoveEmitter-mips-shared.cpp",
194     ]
195     if CONFIG["JS_CODEGEN_MIPS32"]:
196         UNIFIED_SOURCES += [
197             "mips32/Architecture-mips32.cpp",
198             "mips32/Assembler-mips32.cpp",
199             "mips32/CodeGenerator-mips32.cpp",
200             "mips32/Lowering-mips32.cpp",
201             "mips32/MacroAssembler-mips32.cpp",
202             "mips32/MoveEmitter-mips32.cpp",
203             "mips32/Trampoline-mips32.cpp",
204         ]
205         if CONFIG["JS_SIMULATOR_MIPS32"]:
206             UNIFIED_SOURCES += ["mips32/Simulator-mips32.cpp"]
207     elif CONFIG["JS_CODEGEN_MIPS64"]:
208         UNIFIED_SOURCES += [
209             "mips64/Architecture-mips64.cpp",
210             "mips64/Assembler-mips64.cpp",
211             "mips64/CodeGenerator-mips64.cpp",
212             "mips64/Lowering-mips64.cpp",
213             "mips64/MacroAssembler-mips64.cpp",
214             "mips64/MoveEmitter-mips64.cpp",
215             "mips64/Trampoline-mips64.cpp",
216         ]
217         if CONFIG["JS_SIMULATOR_MIPS64"]:
218             UNIFIED_SOURCES += ["mips64/Simulator-mips64.cpp"]
219 elif CONFIG["JS_CODEGEN_LOONG64"]:
220     UNIFIED_SOURCES += [
221         "loong64/Architecture-loong64.cpp",
222         "loong64/Assembler-loong64.cpp",
223         "loong64/CodeGenerator-loong64.cpp",
224         "loong64/Lowering-loong64.cpp",
225         "loong64/MacroAssembler-loong64.cpp",
226         "loong64/MoveEmitter-loong64.cpp",
227         "loong64/Trampoline-loong64.cpp",
228     ]
229     if CONFIG["JS_SIMULATOR_LOONG64"]:
230         UNIFIED_SOURCES += ["loong64/Simulator-loong64.cpp"]
231 elif CONFIG["JS_CODEGEN_RISCV64"]:
232     UNIFIED_SOURCES += [
233         "riscv64/Architecture-riscv64.cpp",
234         "riscv64/Assembler-riscv64.cpp",
235         "riscv64/AssemblerMatInt.cpp",
236         "riscv64/CodeGenerator-riscv64.cpp",
237         "riscv64/constant/Base-constant-riscv.cpp",
238         "riscv64/disasm/Disasm-riscv64.cpp",
239         "riscv64/extension/base-assembler-riscv.cc",
240         "riscv64/extension/base-riscv-i.cc",
241         "riscv64/extension/extension-riscv-a.cc",
242         "riscv64/extension/extension-riscv-c.cc",
243         "riscv64/extension/extension-riscv-d.cc",
244         "riscv64/extension/extension-riscv-f.cc",
245         "riscv64/extension/extension-riscv-m.cc",
246         "riscv64/extension/extension-riscv-v.cc",
247         "riscv64/extension/extension-riscv-zicsr.cc",
248         "riscv64/extension/extension-riscv-zifencei.cc",
249         "riscv64/Lowering-riscv64.cpp",
250         "riscv64/MacroAssembler-riscv64.cpp",
251         "riscv64/MoveEmitter-riscv64.cpp",
252         "riscv64/Trampoline-riscv64.cpp",
253     ]
254     if CONFIG["JS_SIMULATOR_RISCV64"]:
255         UNIFIED_SOURCES += ["riscv64/Simulator-riscv64.cpp"]
256 elif CONFIG["JS_CODEGEN_WASM32"]:
257     UNIFIED_SOURCES += [
258         "wasm32/CodeGenerator-wasm32.cpp",
259         "wasm32/MacroAssembler-wasm32.cpp",
260         "wasm32/Trampoline-wasm32.cpp",
261     ]
263 # Generate jit/MIROpsGenerated.h from jit/MIROps.yaml
264 GeneratedFile(
265     "MIROpsGenerated.h",
266     script="GenerateMIRFiles.py",
267     entry_point="generate_mir_header",
268     inputs=["MIROps.yaml"],
271 # Generate jit/LIROpsGenerated.h from jit/LIR.h, jit/shared/LIR-shared.h, and
272 # platform-specific LIR files.
273 GeneratedFile(
274     "LIROpsGenerated.h",
275     script="GenerateLIRFiles.py",
276     entry_point="generate_lir_header",
277     inputs=["LIROps.yaml"],
280 # Generate jit/CacheIROpsGenerated.h from jit/CacheIROps.yaml
281 GeneratedFile(
282     "CacheIROpsGenerated.h",
283     script="GenerateCacheIRFiles.py",
284     entry_point="generate_cacheirops_header",
285     inputs=["CacheIROps.yaml"],
288 GeneratedFile(
289     "AtomicOperationsGenerated.h",
290     script="GenerateAtomicOperations.py",
291     entry_point="generate_atomics_header",
292     inputs=[],
295 if CONFIG["FUZZING_INTERFACES"] or CONFIG["FUZZING_JS_FUZZILLI"]:
296     include("/tools/fuzzing/libfuzzer-config.mozbuild")