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/.
9 # Includes should be relative to parent path
10 LOCAL_INCLUDES += ["!..", ".."]
12 include("../js-config.mozbuild")
13 include("../js-cxxflags.mozbuild")
17 "AlignmentMaskAnalysis.cpp",
18 "BacktrackingAllocator.cpp",
20 "BaselineBailouts.cpp",
21 "BaselineCacheIRCompiler.cpp",
22 "BaselineCodeGen.cpp",
23 "BaselineDebugModeOSR.cpp",
25 "BaselineFrameInfo.cpp",
29 "BytecodeAnalysis.cpp",
31 "CacheIRCompiler.cpp",
35 "CompileWrappers.cpp",
37 "EdgeCaseAnalysis.cpp",
38 "EffectiveAddressAnalysis.cpp",
39 "ExecutableAllocator.cpp",
41 "FoldLinearArithConstants.cpp",
42 "InlinableNatives.cpp",
43 "InstructionReordering.cpp",
44 "InterpreterEntryTrampoline.cpp",
47 "IonCacheIRCompiler.cpp",
50 "IonOptimizationLevels.cpp",
72 "ProcessExecutableMemory.cpp",
74 "ReciprocalMulConstants.cpp",
76 "RegisterAllocator.cpp",
77 "RematerializedFrame.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",
95 "WarpBuilderShared.cpp",
96 "WarpCacheIRTranspiler.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"]:
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",
116 if CONFIG["JS_CODEGEN_X64"]:
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",
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",
132 elif CONFIG["JS_CODEGEN_ARM"]:
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",
144 if CONFIG["JS_SIMULATOR_ARM"]:
145 UNIFIED_SOURCES += ["arm/Simulator-arm.cpp"]
146 elif CONFIG["OS_ARCH"] == "Darwin":
148 "arm/llvm-compiler-rt/arm/aeabi_idivmod.S",
149 "arm/llvm-compiler-rt/arm/aeabi_uidivmod.S",
151 elif CONFIG["JS_CODEGEN_ARM64"]:
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",
171 vixl_werror_sources = [
172 "arm64/vixl/Disasm-vixl.cpp",
173 "arm64/vixl/Instrument-vixl.cpp",
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"]:
181 "arm64/vixl/Debugger-vixl.cpp",
182 "arm64/vixl/Logic-vixl.cpp",
183 "arm64/vixl/MozSimulator-vixl.cpp",
184 "arm64/vixl/Simulator-vixl.cpp",
186 elif CONFIG["JS_CODEGEN_MIPS32"] or CONFIG["JS_CODEGEN_MIPS64"]:
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",
195 if CONFIG["JS_CODEGEN_MIPS32"]:
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",
205 if CONFIG["JS_SIMULATOR_MIPS32"]:
206 UNIFIED_SOURCES += ["mips32/Simulator-mips32.cpp"]
207 elif CONFIG["JS_CODEGEN_MIPS64"]:
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",
217 if CONFIG["JS_SIMULATOR_MIPS64"]:
218 UNIFIED_SOURCES += ["mips64/Simulator-mips64.cpp"]
219 elif CONFIG["JS_CODEGEN_LOONG64"]:
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",
229 if CONFIG["JS_SIMULATOR_LOONG64"]:
230 UNIFIED_SOURCES += ["loong64/Simulator-loong64.cpp"]
231 elif CONFIG["JS_CODEGEN_RISCV64"]:
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",
254 if CONFIG["JS_SIMULATOR_RISCV64"]:
255 UNIFIED_SOURCES += ["riscv64/Simulator-riscv64.cpp"]
256 elif CONFIG["JS_CODEGEN_WASM32"]:
258 "wasm32/CodeGenerator-wasm32.cpp",
259 "wasm32/MacroAssembler-wasm32.cpp",
260 "wasm32/Trampoline-wasm32.cpp",
263 # Generate jit/MIROpsGenerated.h from jit/MIROps.yaml
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.
275 script="GenerateLIRFiles.py",
276 entry_point="generate_lir_header",
277 inputs=["LIROps.yaml"],
280 # Generate jit/CacheIROpsGenerated.h from jit/CacheIROps.yaml
282 "CacheIROpsGenerated.h",
283 script="GenerateCacheIRFiles.py",
284 entry_point="generate_cacheirops_header",
285 inputs=["CacheIROps.yaml"],
289 "AtomicOperationsGenerated.h",
290 script="GenerateAtomicOperations.py",
291 entry_point="generate_atomics_header",
295 if CONFIG["FUZZING_INTERFACES"] or CONFIG["FUZZING_JS_FUZZILLI"]:
296 include("/tools/fuzzing/libfuzzer-config.mozbuild")