mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1046161 - IonMonkey MIPS: Port latest changes in AsmJSFrameIterator to MIPS. r=luke
This commit is contained in:
parent
927e5632a1
commit
51a330c4bb
@ -109,6 +109,10 @@ static const unsigned StoredFP = 11;
|
|||||||
static const unsigned PushedRetAddr = 4;
|
static const unsigned PushedRetAddr = 4;
|
||||||
static const unsigned PushedFP = 16;
|
static const unsigned PushedFP = 16;
|
||||||
static const unsigned StoredFP = 20;
|
static const unsigned StoredFP = 20;
|
||||||
|
#elif defined(JS_CODEGEN_MIPS)
|
||||||
|
static const unsigned PushedRetAddr = 8;
|
||||||
|
static const unsigned PushedFP = 24;
|
||||||
|
static const unsigned StoredFP = 28;
|
||||||
#elif defined(JS_CODEGEN_NONE)
|
#elif defined(JS_CODEGEN_NONE)
|
||||||
static const unsigned PushedRetAddr = 0;
|
static const unsigned PushedRetAddr = 0;
|
||||||
static const unsigned PushedFP = 1;
|
static const unsigned PushedFP = 1;
|
||||||
@ -294,7 +298,12 @@ js::GenerateAsmJSFunctionEpilogue(MacroAssembler &masm, unsigned framePushed,
|
|||||||
masm.bind(&labels->profilingJump);
|
masm.bind(&labels->profilingJump);
|
||||||
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
|
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
|
||||||
masm.twoByteNop();
|
masm.twoByteNop();
|
||||||
#elif defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS)
|
#elif defined(JS_CODEGEN_ARM)
|
||||||
|
masm.nop();
|
||||||
|
#elif defined(JS_CODEGEN_MIPS)
|
||||||
|
masm.nop();
|
||||||
|
masm.nop();
|
||||||
|
masm.nop();
|
||||||
masm.nop();
|
masm.nop();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1583,6 +1583,9 @@ AsmJSModule::setProfilingEnabled(bool enabled, JSContext *cx)
|
|||||||
BOffImm calleeOffset;
|
BOffImm calleeOffset;
|
||||||
callerInsn->as<InstBLImm>()->extractImm(&calleeOffset);
|
callerInsn->as<InstBLImm>()->extractImm(&calleeOffset);
|
||||||
void *callee = calleeOffset.getDest(callerInsn);
|
void *callee = calleeOffset.getDest(callerInsn);
|
||||||
|
#elif defined(JS_CODEGEN_MIPS)
|
||||||
|
Instruction *instr = (Instruction *)(callerRetAddr - 4 * sizeof(uint32_t));
|
||||||
|
void *callee = (void *)Assembler::ExtractLuiOriValue(instr, instr->next());
|
||||||
#elif defined(JS_CODEGEN_NONE)
|
#elif defined(JS_CODEGEN_NONE)
|
||||||
MOZ_CRASH();
|
MOZ_CRASH();
|
||||||
void *callee = nullptr;
|
void *callee = nullptr;
|
||||||
@ -1604,6 +1607,10 @@ AsmJSModule::setProfilingEnabled(bool enabled, JSContext *cx)
|
|||||||
JSC::X86Assembler::setRel32(callerRetAddr, newCallee);
|
JSC::X86Assembler::setRel32(callerRetAddr, newCallee);
|
||||||
#elif defined(JS_CODEGEN_ARM)
|
#elif defined(JS_CODEGEN_ARM)
|
||||||
new (caller) InstBLImm(BOffImm(newCallee - caller), Assembler::Always);
|
new (caller) InstBLImm(BOffImm(newCallee - caller), Assembler::Always);
|
||||||
|
#elif defined(JS_CODEGEN_MIPS)
|
||||||
|
Assembler::WriteLuiOriInstructions(instr, instr->next(),
|
||||||
|
ScratchRegister, (uint32_t)newCallee);
|
||||||
|
instr[2] = InstReg(op_special, ScratchRegister, zero, ra, ff_jalr);
|
||||||
#elif defined(JS_CODEGEN_NONE)
|
#elif defined(JS_CODEGEN_NONE)
|
||||||
MOZ_CRASH();
|
MOZ_CRASH();
|
||||||
#else
|
#else
|
||||||
@ -1663,6 +1670,17 @@ AsmJSModule::setProfilingEnabled(bool enabled, JSContext *cx)
|
|||||||
JS_ASSERT(reinterpret_cast<Instruction*>(jump)->is<InstBImm>());
|
JS_ASSERT(reinterpret_cast<Instruction*>(jump)->is<InstBImm>());
|
||||||
new (jump) InstNOP();
|
new (jump) InstNOP();
|
||||||
}
|
}
|
||||||
|
#elif defined(JS_CODEGEN_MIPS)
|
||||||
|
Instruction *instr = (Instruction *)jump;
|
||||||
|
if (enabled) {
|
||||||
|
Assembler::WriteLuiOriInstructions(instr, instr->next(),
|
||||||
|
ScratchRegister, (uint32_t)profilingEpilogue);
|
||||||
|
instr[2] = InstReg(op_special, ScratchRegister, zero, zero, ff_jr);
|
||||||
|
} else {
|
||||||
|
instr[0].makeNop();
|
||||||
|
instr[1].makeNop();
|
||||||
|
instr[2].makeNop();
|
||||||
|
}
|
||||||
#elif defined(JS_CODEGEN_NONE)
|
#elif defined(JS_CODEGEN_NONE)
|
||||||
MOZ_CRASH();
|
MOZ_CRASH();
|
||||||
#else
|
#else
|
||||||
|
@ -939,6 +939,18 @@ MacroAssemblerMIPS::branchWithCode(InstImm code, Label *label, JumpKind jumpKind
|
|||||||
if (label->bound()) {
|
if (label->bound()) {
|
||||||
int32_t offset = label->offset() - m_buffer.nextOffset().getOffset();
|
int32_t offset = label->offset() - m_buffer.nextOffset().getOffset();
|
||||||
|
|
||||||
|
// Generate the long jump for calls because return address has to be
|
||||||
|
// the address after the reserved block.
|
||||||
|
if (code.encode() == inst_bgezal.encode()) {
|
||||||
|
MOZ_ASSERT(jumpKind != ShortJump);
|
||||||
|
// Handle long call
|
||||||
|
addLongJump(nextOffset());
|
||||||
|
ma_liPatchable(ScratchRegister, Imm32(label->offset()));
|
||||||
|
as_jalr(ScratchRegister);
|
||||||
|
as_nop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (BOffImm16::IsInRange(offset))
|
if (BOffImm16::IsInRange(offset))
|
||||||
jumpKind = ShortJump;
|
jumpKind = ShortJump;
|
||||||
|
|
||||||
@ -950,15 +962,6 @@ MacroAssemblerMIPS::branchWithCode(InstImm code, Label *label, JumpKind jumpKind
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate long jump because target is out of range of short jump.
|
|
||||||
if (code.encode() == inst_bgezal.encode()) {
|
|
||||||
// Handle long call
|
|
||||||
addLongJump(nextOffset());
|
|
||||||
ma_liPatchable(ScratchRegister, Imm32(label->offset()));
|
|
||||||
as_jalr(ScratchRegister);
|
|
||||||
as_nop();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (code.encode() == inst_beq.encode()) {
|
if (code.encode() == inst_beq.encode()) {
|
||||||
// Handle long jump
|
// Handle long jump
|
||||||
addLongJump(nextOffset());
|
addLongJump(nextOffset());
|
||||||
|
@ -1092,6 +1092,12 @@ public:
|
|||||||
void store32(Imm32 src, const Address &address);
|
void store32(Imm32 src, const Address &address);
|
||||||
void store32(Imm32 src, const BaseIndex &address);
|
void store32(Imm32 src, const BaseIndex &address);
|
||||||
|
|
||||||
|
// NOTE: This will use second scratch on MIPS. Only ARM needs the
|
||||||
|
// implementation without second scratch.
|
||||||
|
void store32_NoSecondScratch(Imm32 src, const Address &address) {
|
||||||
|
store32(src, address);
|
||||||
|
}
|
||||||
|
|
||||||
void storePtr(ImmWord imm, const Address &address);
|
void storePtr(ImmWord imm, const Address &address);
|
||||||
void storePtr(ImmPtr imm, const Address &address);
|
void storePtr(ImmPtr imm, const Address &address);
|
||||||
void storePtr(ImmGCPtr imm, const Address &address);
|
void storePtr(ImmGCPtr imm, const Address &address);
|
||||||
|
Loading…
Reference in New Issue
Block a user