| 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/. |
| 6 |
|
| 7 |
FINAL_LIBRARY = "js" |
| 8 |
|
| 9 |
# Includes should be relative to parent path |
| 10 |
LOCAL_INCLUDES += ["!..", ".."] |
| 11 |
|
| 12 |
include("../js-config.mozbuild") |
| 13 |
include("../js-cxxflags.mozbuild") |
| 14 |
|
| 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 |
"BaselineCompileTask.cpp", |
| 24 |
"BaselineDebugModeOSR.cpp", |
| 25 |
"BaselineFrame.cpp", |
| 26 |
"BaselineFrameInfo.cpp", |
| 27 |
"BaselineIC.cpp", |
| 28 |
"BaselineJIT.cpp", |
| 29 |
"BitSet.cpp", |
| 30 |
"BranchHinting.cpp", |
| 31 |
"BytecodeAnalysis.cpp", |
| 32 |
"CacheIR.cpp", |
| 33 |
"CacheIRAOT.cpp", |
| 34 |
"CacheIRCompiler.cpp", |
| 35 |
"CacheIRHealth.cpp", |
| 36 |
"CacheIRSpewer.cpp", |
| 37 |
"CodeGenerator.cpp", |
| 38 |
"CompileWrappers.cpp", |
| 39 |
"Disassemble.cpp", |
| 40 |
"DominatorTree.cpp", |
| 41 |
"EdgeCaseAnalysis.cpp", |
| 42 |
"EffectiveAddressAnalysis.cpp", |
| 43 |
"ExecutableAllocator.cpp", |
| 44 |
"FlushICache.cpp", |
| 45 |
"FoldLinearArithConstants.cpp", |
| 46 |
"InlinableNatives.cpp", |
| 47 |
"InstructionReordering.cpp", |
| 48 |
"InterpreterEntryTrampoline.cpp", |
| 49 |
"Ion.cpp", |
| 50 |
"IonAnalysis.cpp", |
| 51 |
"IonCacheIRCompiler.cpp", |
| 52 |
"IonCompileTask.cpp", |
| 53 |
"IonIC.cpp", |
| 54 |
"IonOptimizationLevels.cpp", |
| 55 |
"Jit.cpp", |
| 56 |
"JitcodeMap.cpp", |
| 57 |
"JitContext.cpp", |
| 58 |
"JitFrames.cpp", |
| 59 |
"JitHints.cpp", |
| 60 |
"JitOptions.cpp", |
| 61 |
"JitScript.cpp", |
| 62 |
"JitSpewer.cpp", |
| 63 |
"JSJitFrameIter.cpp", |
| 64 |
"JSONSpewer.cpp", |
| 65 |
"KnownClass.cpp", |
| 66 |
"Label.cpp", |
| 67 |
"LICM.cpp", |
| 68 |
"Linker.cpp", |
| 69 |
"LIR.cpp", |
| 70 |
"Lowering.cpp", |
| 71 |
"MacroAssembler.cpp", |
| 72 |
"MIR-wasm.cpp", |
| 73 |
"MIR.cpp", |
| 74 |
"MIRGraph.cpp", |
| 75 |
"MoveResolver.cpp", |
| 76 |
"PerfSpewer.cpp", |
| 77 |
"ProcessExecutableMemory.cpp", |
| 78 |
"RangeAnalysis.cpp", |
| 79 |
"ReciprocalMulConstants.cpp", |
| 80 |
"Recover.cpp", |
| 81 |
"RegisterAllocator.cpp", |
| 82 |
"RematerializedFrame.cpp", |
| 83 |
"SafepointIndex.cpp", |
| 84 |
"Safepoints.cpp", |
| 85 |
"ScalarReplacement.cpp", |
| 86 |
"shared/Assembler-shared.cpp", |
| 87 |
"shared/AtomicOperations-shared-jit.cpp", |
| 88 |
"shared/CodeGenerator-shared.cpp", |
| 89 |
"shared/Disassembler-shared.cpp", |
| 90 |
"shared/Lowering-shared.cpp", |
| 91 |
"ShuffleAnalysis.cpp", |
| 92 |
"SimpleAllocator.cpp", |
| 93 |
"Sink.cpp", |
| 94 |
"Snapshots.cpp", |
| 95 |
"Trampoline.cpp", |
| 96 |
"TrampolineNatives.cpp", |
| 97 |
"TrialInlining.cpp", |
| 98 |
"TypePolicy.cpp", |
| 99 |
"UnrollLoops.cpp", |
| 100 |
"ValueNumbering.cpp", |
| 101 |
"VMFunctions.cpp", |
| 102 |
"WarpBuilder.cpp", |
| 103 |
"WarpBuilderShared.cpp", |
| 104 |
"WarpCacheIRTranspiler.cpp", |
| 105 |
"WarpOracle.cpp", |
| 106 |
"WarpSnapshot.cpp", |
| 107 |
"WasmBCE.cpp", |
| 108 |
"XrayJitInfo.cpp", |
| 109 |
] |
| 110 |
|
| 111 |
if CONFIG["JS_CODEGEN_NONE"]: |
| 112 |
UNIFIED_SOURCES += ["none/Trampoline-none.cpp"] |
| 113 |
elif CONFIG["JS_CODEGEN_X86"] or CONFIG["JS_CODEGEN_X64"]: |
| 114 |
UNIFIED_SOURCES += [ |
| 115 |
"x86-shared/Architecture-x86-shared.cpp", |
| 116 |
"x86-shared/Assembler-x86-shared.cpp", |
| 117 |
"x86-shared/AssemblerBuffer-x86-shared.cpp", |
| 118 |
"x86-shared/CodeGenerator-x86-shared.cpp", |
| 119 |
"x86-shared/Lowering-x86-shared.cpp", |
| 120 |
"x86-shared/MacroAssembler-x86-shared-SIMD.cpp", |
| 121 |
"x86-shared/MacroAssembler-x86-shared.cpp", |
| 122 |
"x86-shared/MoveEmitter-x86-shared.cpp", |
| 123 |
] |
| 124 |
if CONFIG["JS_CODEGEN_X64"]: |
| 125 |
UNIFIED_SOURCES += [ |
| 126 |
"x64/Assembler-x64.cpp", |
| 127 |
"x64/CodeGenerator-x64.cpp", |
| 128 |
"x64/Lowering-x64.cpp", |
| 129 |
"x64/MacroAssembler-x64.cpp", |
| 130 |
"x64/Trampoline-x64.cpp", |
| 131 |
] |
| 132 |
else: |
| 133 |
UNIFIED_SOURCES += [ |
| 134 |
"x86/Assembler-x86.cpp", |
| 135 |
"x86/CodeGenerator-x86.cpp", |
| 136 |
"x86/Lowering-x86.cpp", |
| 137 |
"x86/MacroAssembler-x86.cpp", |
| 138 |
"x86/Trampoline-x86.cpp", |
| 139 |
] |
| 140 |
elif CONFIG["JS_CODEGEN_ARM"]: |
| 141 |
UNIFIED_SOURCES += [ |
| 142 |
"arm/Architecture-arm.cpp", |
| 143 |
"arm/Assembler-arm.cpp", |
| 144 |
"arm/CodeGenerator-arm.cpp", |
| 145 |
"arm/disasm/Constants-arm.cpp", |
| 146 |
"arm/disasm/Disasm-arm.cpp", |
| 147 |
"arm/Lowering-arm.cpp", |
| 148 |
"arm/MacroAssembler-arm.cpp", |
| 149 |
"arm/MoveEmitter-arm.cpp", |
| 150 |
"arm/Trampoline-arm.cpp", |
| 151 |
] |
| 152 |
if CONFIG["JS_SIMULATOR_ARM"]: |
| 153 |
UNIFIED_SOURCES += ["arm/Simulator-arm.cpp"] |
| 154 |
elif CONFIG["OS_ARCH"] == "Darwin": |
| 155 |
SOURCES += [ |
| 156 |
"arm/llvm-compiler-rt/arm/aeabi_idivmod.S", |
| 157 |
"arm/llvm-compiler-rt/arm/aeabi_uidivmod.S", |
| 158 |
] |
| 159 |
elif CONFIG["JS_CODEGEN_ARM64"]: |
| 160 |
UNIFIED_SOURCES += [ |
| 161 |
"arm64/Architecture-arm64.cpp", |
| 162 |
"arm64/Assembler-arm64.cpp", |
| 163 |
"arm64/CodeGenerator-arm64.cpp", |
| 164 |
"arm64/Lowering-arm64.cpp", |
| 165 |
"arm64/MacroAssembler-arm64.cpp", |
| 166 |
"arm64/MoveEmitter-arm64.cpp", |
| 167 |
"arm64/Trampoline-arm64.cpp", |
| 168 |
"arm64/vixl/Assembler-vixl.cpp", |
| 169 |
"arm64/vixl/Cpu-Features-vixl.cpp", |
| 170 |
"arm64/vixl/Cpu-vixl.cpp", |
| 171 |
"arm64/vixl/Decoder-vixl.cpp", |
| 172 |
"arm64/vixl/Instructions-vixl.cpp", |
| 173 |
"arm64/vixl/MacroAssembler-vixl.cpp", |
| 174 |
"arm64/vixl/MozAssembler-vixl.cpp", |
| 175 |
"arm64/vixl/MozCpu-vixl.cpp", |
| 176 |
"arm64/vixl/MozInstructions-vixl.cpp", |
| 177 |
"arm64/vixl/Utils-vixl.cpp", |
| 178 |
] |
| 179 |
vixl_werror_sources = [ |
| 180 |
"arm64/vixl/Disasm-vixl.cpp", |
| 181 |
"arm64/vixl/Instrument-vixl.cpp", |
| 182 |
] |
| 183 |
SOURCES += vixl_werror_sources |
| 184 |
if CONFIG["CC_TYPE"] == "clang-cl": |
| 185 |
for f in vixl_werror_sources: |
| 186 |
SOURCES[f].flags += ["-Wno-c++11-narrowing"] |
| 187 |
if CONFIG["JS_SIMULATOR_ARM64"]: |
| 188 |
UNIFIED_SOURCES += [ |
| 189 |
"arm64/vixl/Debugger-vixl.cpp", |
| 190 |
"arm64/vixl/Logic-vixl.cpp", |
| 191 |
"arm64/vixl/MozSimulator-vixl.cpp", |
| 192 |
"arm64/vixl/Simulator-vixl.cpp", |
| 193 |
] |
| 194 |
elif CONFIG["JS_CODEGEN_MIPS64"]: |
| 195 |
UNIFIED_SOURCES += [ |
| 196 |
"mips-shared/Architecture-mips-shared.cpp", |
| 197 |
"mips-shared/Assembler-mips-shared.cpp", |
| 198 |
"mips-shared/CodeGenerator-mips-shared.cpp", |
| 199 |
"mips-shared/Lowering-mips-shared.cpp", |
| 200 |
"mips-shared/MacroAssembler-mips-shared.cpp", |
| 201 |
"mips-shared/MoveEmitter-mips-shared.cpp", |
| 202 |
"mips64/Architecture-mips64.cpp", |
| 203 |
"mips64/Assembler-mips64.cpp", |
| 204 |
"mips64/CodeGenerator-mips64.cpp", |
| 205 |
"mips64/Lowering-mips64.cpp", |
| 206 |
"mips64/MacroAssembler-mips64.cpp", |
| 207 |
"mips64/MoveEmitter-mips64.cpp", |
| 208 |
"mips64/Trampoline-mips64.cpp", |
| 209 |
] |
| 210 |
if CONFIG["JS_SIMULATOR_MIPS64"]: |
| 211 |
UNIFIED_SOURCES += ["mips64/Simulator-mips64.cpp"] |
| 212 |
elif CONFIG["JS_CODEGEN_LOONG64"]: |
| 213 |
UNIFIED_SOURCES += [ |
| 214 |
"loong64/Architecture-loong64.cpp", |
| 215 |
"loong64/Assembler-loong64.cpp", |
| 216 |
"loong64/CodeGenerator-loong64.cpp", |
| 217 |
"loong64/Lowering-loong64.cpp", |
| 218 |
"loong64/MacroAssembler-loong64.cpp", |
| 219 |
"loong64/MoveEmitter-loong64.cpp", |
| 220 |
"loong64/Trampoline-loong64.cpp", |
| 221 |
] |
| 222 |
if CONFIG["JS_SIMULATOR_LOONG64"]: |
| 223 |
UNIFIED_SOURCES += ["loong64/Simulator-loong64.cpp"] |
| 224 |
elif CONFIG["JS_CODEGEN_RISCV64"]: |
| 225 |
UNIFIED_SOURCES += [ |
| 226 |
"riscv64/Architecture-riscv64.cpp", |
| 227 |
"riscv64/Assembler-riscv64.cpp", |
| 228 |
"riscv64/AssemblerMatInt.cpp", |
| 229 |
"riscv64/CodeGenerator-riscv64.cpp", |
| 230 |
"riscv64/constant/Base-constant-riscv.cpp", |
| 231 |
"riscv64/disasm/Disasm-riscv64.cpp", |
| 232 |
"riscv64/extension/base-assembler-riscv.cc", |
| 233 |
"riscv64/extension/base-riscv-i.cc", |
| 234 |
"riscv64/extension/extension-riscv-a.cc", |
| 235 |
"riscv64/extension/extension-riscv-c.cc", |
| 236 |
"riscv64/extension/extension-riscv-d.cc", |
| 237 |
"riscv64/extension/extension-riscv-f.cc", |
| 238 |
"riscv64/extension/extension-riscv-m.cc", |
| 239 |
"riscv64/extension/extension-riscv-v.cc", |
| 240 |
"riscv64/extension/extension-riscv-zicsr.cc", |
| 241 |
"riscv64/extension/extension-riscv-zifencei.cc", |
| 242 |
"riscv64/Lowering-riscv64.cpp", |
| 243 |
"riscv64/MacroAssembler-riscv64.cpp", |
| 244 |
"riscv64/MoveEmitter-riscv64.cpp", |
| 245 |
"riscv64/Trampoline-riscv64.cpp", |
| 246 |
] |
| 247 |
if CONFIG["JS_SIMULATOR_RISCV64"]: |
| 248 |
UNIFIED_SOURCES += ["riscv64/Simulator-riscv64.cpp"] |
| 249 |
elif CONFIG["JS_CODEGEN_WASM32"]: |
| 250 |
UNIFIED_SOURCES += [ |
| 251 |
"wasm32/CodeGenerator-wasm32.cpp", |
| 252 |
"wasm32/MacroAssembler-wasm32.cpp", |
| 253 |
"wasm32/Trampoline-wasm32.cpp", |
| 254 |
] |
| 255 |
|
| 256 |
# Generate jit/ABIFunctionTypeGenerated.h from jit/ABIFunctionType.yaml |
| 257 |
GeneratedFile( |
| 258 |
"ABIFunctionTypeGenerated.h", |
| 259 |
script="GenerateABIFunctionType.py", |
| 260 |
inputs=["ABIFunctionType.yaml"], |
| 261 |
) |
| 262 |
|
| 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"], |
| 269 |
) |
| 270 |
|
| 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", "MIROps.yaml"], |
| 278 |
) |
| 279 |
|
| 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"], |
| 286 |
) |
| 287 |
|
| 288 |
GeneratedFile( |
| 289 |
"AtomicOperationsGenerated.h", |
| 290 |
script="GenerateAtomicOperations.py", |
| 291 |
entry_point="generate_atomics_header", |
| 292 |
inputs=[], |
| 293 |
) |
| 294 |
|
| 295 |
if CONFIG["ENABLE_JS_AOT_ICS"]: |
| 296 |
GeneratedFile( |
| 297 |
"CacheIRAOTGenerated.h", |
| 298 |
script="GenerateCacheIRFiles.py", |
| 299 |
entry_point="generate_aot_ics_header", |
| 300 |
inputs=["../ics/"], |
| 301 |
force=True, # depends on list of files in js/src/ics/; always rebuild |
| 302 |
) |
| 303 |
|
| 304 |
if CONFIG["FUZZING_INTERFACES"] or CONFIG["FUZZING_JS_FUZZILLI"]: |
| 305 |
include("/tools/fuzzing/libfuzzer-config.mozbuild") |