Bug 1639153 - Part 6.2: Establish dependency from tls for x86 callWithABI div/mod...
[gecko.git] / js / src / jit / Lowering.h
blob4a129cda10abdd2c31c1a700051d8ea9d39ad3ee
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/. */
7 #ifndef jit_Lowering_h
8 #define jit_Lowering_h
10 // This file declares the structures that are used for attaching LIR to a
11 // MIRGraph.
13 #include "jit/LIR.h"
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"
28 #else
29 # error "Unknown architecture!"
30 #endif
32 namespace js {
33 namespace jit {
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_;
42 public:
43 LIRGenerator(MIRGenerator* gen, MIRGraph& graph, LIRGraph& lirGraph)
44 : LIRGeneratorSpecific(gen, graph, lirGraph), maxargslots_(0) {}
46 MOZ_MUST_USE bool generate();
48 private:
49 LBoxAllocation useBoxFixedAtStart(MDefinition* mir, Register reg1,
50 Register reg2) {
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);
60 void definePhis();
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)
72 #undef MIR_OP
75 } // namespace jit
76 } // namespace js
78 #endif /* jit_Lowering_h */