1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
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/. */
10 // This file declares the structures that are used for attaching LIR to a
14 #if defined(JS_CODEGEN_X86)
15 # include "jit/x86/Lowering-x86.h"
16 #elif defined(JS_CODEGEN_X64)
17 # include "jit/x64/Lowering-x64.h"
18 #elif defined(JS_CODEGEN_ARM)
19 # include "jit/arm/Lowering-arm.h"
20 #elif defined(JS_CODEGEN_ARM64)
21 # include "jit/arm64/Lowering-arm64.h"
22 #elif defined(JS_CODEGEN_MIPS32)
23 # include "jit/mips32/Lowering-mips32.h"
24 #elif defined(JS_CODEGEN_MIPS64)
25 # include "jit/mips64/Lowering-mips64.h"
26 #elif defined(JS_CODEGEN_NONE)
27 # include "jit/none/Lowering-none.h"
29 # error "Unknown architecture!"
35 class LIRGenerator final
: public LIRGeneratorSpecific
{
36 void updateResumeState(MInstruction
* ins
);
37 void updateResumeState(MBasicBlock
* block
);
39 // The maximum depth, for framesizeclass determination.
40 uint32_t maxargslots_
;
43 LIRGenerator(MIRGenerator
* gen
, MIRGraph
& graph
, LIRGraph
& lirGraph
)
44 : LIRGeneratorSpecific(gen
, graph
, lirGraph
), maxargslots_(0) {}
46 MOZ_MUST_USE
bool generate();
49 LBoxAllocation
useBoxFixedAtStart(MDefinition
* mir
, Register reg1
,
51 return useBoxFixed(mir
, reg1
, reg2
, /* useAtStart = */ true);
54 LBoxAllocation
useBoxFixedAtStart(MDefinition
* mir
, ValueOperand op
);
55 LBoxAllocation
useBoxAtStart(MDefinition
* mir
,
56 LUse::Policy policy
= LUse::REGISTER
);
58 void lowerBitOp(JSOp op
, MBinaryBitwiseInstruction
* ins
);
59 void lowerShiftOp(JSOp op
, MShiftInstruction
* ins
);
62 MOZ_MUST_USE
bool lowerCallArguments(MCall
* call
);
64 friend class LIRGeneratorShared
;
65 void visitInstructionDispatch(MInstruction
* ins
);
67 MOZ_MUST_USE
bool visitInstruction(MInstruction
* ins
);
68 MOZ_MUST_USE
bool visitBlock(MBasicBlock
* block
);
70 #define MIR_OP(op) void visit##op(M##op* ins);
71 MIR_OPCODE_LIST(MIR_OP
)
78 #endif /* jit_Lowering_h */