moz.build
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
FINAL_LIBRARY = 'js'
# Includes should be relative to parent path
LOCAL_INCLUDES += [
'!..',
'..'
]
include('../js-config.mozbuild')
include('../js-cxxflags.mozbuild')
# Generate jit/MOpcodes.h from jit/MIR.h
GENERATED_FILES += ['MOpcodes.h']
MOpcodesGenerated = GENERATED_FILES['MOpcodes.h']
MOpcodesGenerated.script = 'GenerateOpcodeFiles.py:generate_mir_header'
MOpcodesGenerated.inputs = ['MIR.h']
# Generate jit/LOpcodes.h from jit/LIR.h, jit/shared/LIR-shared.h, and
# platform-specific LIR files.
GENERATED_FILES += ['LOpcodes.h']
LOpcodesGenerated = GENERATED_FILES['LOpcodes.h']
LOpcodesGenerated.script = 'GenerateOpcodeFiles.py:generate_lir_header'
LOpcodesGenerated.inputs = ['LIR.h', 'shared/LIR-shared.h']
UNIFIED_SOURCES += [
'AliasAnalysis.cpp',
'AlignmentMaskAnalysis.cpp',
'BacktrackingAllocator.cpp',
'Bailouts.cpp',
'BaselineBailouts.cpp',
'BaselineCacheIRCompiler.cpp',
'BaselineCompiler.cpp',
'BaselineDebugModeOSR.cpp',
'BaselineFrame.cpp',
'BaselineFrameInfo.cpp',
'BaselineIC.cpp',
'BaselineInspector.cpp',
'BaselineJIT.cpp',
'BitSet.cpp',
'BytecodeAnalysis.cpp',
'CacheIR.cpp',
'CacheIRCompiler.cpp',
'CacheIRSpewer.cpp',
'CodeGenerator.cpp',
'CompileWrappers.cpp',
'EdgeCaseAnalysis.cpp',
'EffectiveAddressAnalysis.cpp',
'ExecutableAllocator.cpp',
'FoldLinearArithConstants.cpp',
'InstructionReordering.cpp',
'Ion.cpp',
'IonAnalysis.cpp',
'IonBuilder.cpp',
'IonCacheIRCompiler.cpp',
'IonControlFlow.cpp',
'IonIC.cpp',
'IonOptimizationLevels.cpp',
'Jit.cpp',
'JitcodeMap.cpp',
'JitFrames.cpp',
'JitOptions.cpp',
'JitSpewer.cpp',
'JSJitFrameIter.cpp',
'JSONSpewer.cpp',
'LICM.cpp',
'Linker.cpp',
'LIR.cpp',
'Lowering.cpp',
'MacroAssembler.cpp',
'MCallOptimize.cpp',
'MIR.cpp',
'MIRGraph.cpp',
'MoveResolver.cpp',
'OptimizationTracking.cpp',
'PerfSpewer.cpp',
'ProcessExecutableMemory.cpp',
'RangeAnalysis.cpp',
'Recover.cpp',
'RegisterAllocator.cpp',
'RematerializedFrame.cpp',
'Safepoints.cpp',
'ScalarReplacement.cpp',
'shared/Assembler-shared.cpp',
'shared/CodeGenerator-shared.cpp',
'shared/Disassembler-shared.cpp',
'shared/Lowering-shared.cpp',
'Sink.cpp',
'Snapshots.cpp',
'StupidAllocator.cpp',
'TypedObjectPrediction.cpp',
'TypePolicy.cpp',
'ValueNumbering.cpp',
'VMFunctions.cpp',
'WasmBCE.cpp',
]
if not CONFIG['ENABLE_ION']:
LOpcodesGenerated.inputs += ['none/LIR-none.h']
UNIFIED_SOURCES += [
'none/Trampoline-none.cpp'
]
elif CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']:
LOpcodesGenerated.inputs += ['x86-shared/LIR-x86-shared.h']
UNIFIED_SOURCES += [
'shared/AtomicOperations-shared-jit.cpp',
'x86-shared/Architecture-x86-shared.cpp',
'x86-shared/Assembler-x86-shared.cpp',
'x86-shared/AssemblerBuffer-x86-shared.cpp',
'x86-shared/CodeGenerator-x86-shared.cpp',
'x86-shared/Lowering-x86-shared.cpp',
'x86-shared/MacroAssembler-x86-shared-SIMD.cpp',
'x86-shared/MacroAssembler-x86-shared.cpp',
'x86-shared/MoveEmitter-x86-shared.cpp',
]
if CONFIG['JS_CODEGEN_X64']:
LOpcodesGenerated.inputs += ['x64/LIR-x64.h']
UNIFIED_SOURCES += [
'x64/Assembler-x64.cpp',
'x64/Bailouts-x64.cpp',
'x64/CodeGenerator-x64.cpp',
'x64/Lowering-x64.cpp',
'x64/MacroAssembler-x64.cpp',
'x64/Trampoline-x64.cpp',
]
else:
LOpcodesGenerated.inputs += ['x86/LIR-x86.h']
UNIFIED_SOURCES += [
'x86/Assembler-x86.cpp',
'x86/Bailouts-x86.cpp',
'x86/CodeGenerator-x86.cpp',
'x86/Lowering-x86.cpp',
'x86/MacroAssembler-x86.cpp',
'x86/Trampoline-x86.cpp',
]
elif CONFIG['JS_CODEGEN_ARM']:
LOpcodesGenerated.inputs += ['arm/LIR-arm.h']
UNIFIED_SOURCES += [
'arm/Architecture-arm.cpp',
'arm/Assembler-arm.cpp',
'arm/Bailouts-arm.cpp',
'arm/CodeGenerator-arm.cpp',
'arm/disasm/Constants-arm.cpp',
'arm/disasm/Disasm-arm.cpp',
'arm/Lowering-arm.cpp',
'arm/MacroAssembler-arm.cpp',
'arm/MoveEmitter-arm.cpp',
'arm/Trampoline-arm.cpp',
'shared/AtomicOperations-shared-jit.cpp',
]
if CONFIG['JS_SIMULATOR_ARM']:
UNIFIED_SOURCES += [
'arm/Simulator-arm.cpp'
]
elif CONFIG['OS_ARCH'] == 'Darwin':
SOURCES += [
'arm/llvm-compiler-rt/arm/aeabi_idivmod.S',
'arm/llvm-compiler-rt/arm/aeabi_uidivmod.S',
]
elif CONFIG['JS_CODEGEN_ARM64']:
LOpcodesGenerated.inputs += ['arm64/LIR-arm64.h']
UNIFIED_SOURCES += [
'arm64/Architecture-arm64.cpp',
'arm64/Assembler-arm64.cpp',
'arm64/Bailouts-arm64.cpp',
'arm64/CodeGenerator-arm64.cpp',
'arm64/Lowering-arm64.cpp',
'arm64/MacroAssembler-arm64.cpp',
'arm64/MoveEmitter-arm64.cpp',
'arm64/Trampoline-arm64.cpp',
'arm64/vixl/Assembler-vixl.cpp',
'arm64/vixl/Cpu-vixl.cpp',
'arm64/vixl/Decoder-vixl.cpp',
'arm64/vixl/Instructions-vixl.cpp',
'arm64/vixl/MacroAssembler-vixl.cpp',
'arm64/vixl/MozAssembler-vixl.cpp',
'arm64/vixl/MozCpu-vixl.cpp',
'arm64/vixl/MozInstructions-vixl.cpp',
'arm64/vixl/Utils-vixl.cpp',
'shared/AtomicOperations-shared-jit.cpp',
]
vixl_werror_sources = [
'arm64/vixl/Disasm-vixl.cpp',
'arm64/vixl/Instrument-vixl.cpp',
]
SOURCES += vixl_werror_sources
if CONFIG['CC_TYPE'] == 'clang-cl':
for f in vixl_werror_sources:
SOURCES[f].flags += ['-Wno-c++11-narrowing']
if CONFIG['JS_SIMULATOR_ARM64']:
UNIFIED_SOURCES += [
'arm64/vixl/Debugger-vixl.cpp',
'arm64/vixl/Logic-vixl.cpp',
'arm64/vixl/MozSimulator-vixl.cpp',
'arm64/vixl/Simulator-vixl.cpp'
]
elif CONFIG['JS_CODEGEN_MIPS32'] or CONFIG['JS_CODEGEN_MIPS64']:
LOpcodesGenerated.inputs += ['mips-shared/LIR-mips-shared.h']
UNIFIED_SOURCES += [
'mips-shared/Architecture-mips-shared.cpp',
'mips-shared/Assembler-mips-shared.cpp',
'mips-shared/Bailouts-mips-shared.cpp',
'mips-shared/CodeGenerator-mips-shared.cpp',
'mips-shared/Lowering-mips-shared.cpp',
'mips-shared/MacroAssembler-mips-shared.cpp',
'mips-shared/MoveEmitter-mips-shared.cpp',
]
if CONFIG['JS_CODEGEN_MIPS32']:
LOpcodesGenerated.inputs += ['mips32/LIR-mips32.h']
UNIFIED_SOURCES += [
'mips32/Architecture-mips32.cpp',
'mips32/Assembler-mips32.cpp',
'mips32/Bailouts-mips32.cpp',
'mips32/CodeGenerator-mips32.cpp',
'mips32/Lowering-mips32.cpp',
'mips32/MacroAssembler-mips32.cpp',
'mips32/MoveEmitter-mips32.cpp',
'mips32/Trampoline-mips32.cpp',
]
if CONFIG['JS_SIMULATOR_MIPS32']:
UNIFIED_SOURCES += [
'mips32/Simulator-mips32.cpp'
]
elif CONFIG['JS_CODEGEN_MIPS64']:
LOpcodesGenerated.inputs += ['mips64/LIR-mips64.h']
UNIFIED_SOURCES += [
'mips64/Architecture-mips64.cpp',
'mips64/Assembler-mips64.cpp',
'mips64/Bailouts-mips64.cpp',
'mips64/CodeGenerator-mips64.cpp',
'mips64/Lowering-mips64.cpp',
'mips64/MacroAssembler-mips64.cpp',
'mips64/MoveEmitter-mips64.cpp',
'mips64/Trampoline-mips64.cpp',
]
if CONFIG['JS_SIMULATOR_MIPS64']:
UNIFIED_SOURCES += [
'mips64/Simulator-mips64.cpp'
]