Bug 1015180 - Move linkExitFrame to the common MacroAssembler. r=jandem

This commit is contained in:
Nicolas B. Pierron 2014-05-26 06:54:33 -07:00
parent 3d266c9089
commit b1ee29f402
8 changed files with 22 additions and 56 deletions

View File

@ -892,6 +892,24 @@ MacroAssembler::checkInterruptFlagPar(Register tempReg, Label *fail)
#endif
}
// Save an exit frame (which must be aligned to the stack pointer) to
// PerThreadData::jitTop of the main thread.
void
MacroAssembler::linkExitFrame()
{
AbsoluteAddress jitTop(GetIonContext()->runtime->addressOfJitTop());
storePtr(StackPointer, jitTop);
}
// Save an exit frame to the thread data of the current thread, given a
// register that holds a PerThreadData *.
void
MacroAssembler::linkParallelExitFrame(Register pt)
{
Address jitTop(pt, offsetof(PerThreadData, jitTop));
storePtr(StackPointer, jitTop);
}
static void
ReportOverRecursed(JSContext *cx)
{

View File

@ -850,6 +850,10 @@ class MacroAssembler : public MacroAssemblerSpecific
private:
CodeOffsetLabel exitCodePatch_;
private:
void linkExitFrame();
void linkParallelExitFrame(Register pt);
public:
void enterExitFrame(const VMFunction *f = nullptr) {
linkExitFrame();

View File

@ -3520,20 +3520,6 @@ MacroAssemblerARMCompat::storeTypeTag(ImmTag tag, Register base, Register index,
ma_sub(base, Imm32(NUNBOX32_TYPE_OFFSET), base);
}
void
MacroAssemblerARMCompat::linkExitFrame()
{
uint8_t *dest = (uint8_t*)GetIonContext()->runtime->addressOfJitTop();
movePtr(ImmPtr(dest), ScratchRegister);
ma_str(StackPointer, Operand(ScratchRegister, 0));
}
void
MacroAssemblerARMCompat::linkParallelExitFrame(Register pt)
{
ma_str(StackPointer, Operand(pt, offsetof(PerThreadData, jitTop)));
}
// ARM says that all reads of pc will return 8 higher than the
// address of the currently executing instruction. This means we are
// correctly storing the address of the instruction after the call

View File

@ -1191,8 +1191,6 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
ma_orr(Imm32(type), frameSizeReg);
}
void linkExitFrame();
void linkParallelExitFrame(Register pt);
void handleFailureWithHandler(void *handler);
void handleFailureWithHandlerTail();

View File

@ -2901,20 +2901,6 @@ MacroAssemblerMIPSCompat::storeTypeTag(ImmTag tag, Register base, Register index
as_sw(ScratchRegister, SecondScratchReg, TAG_OFFSET);
}
void
MacroAssemblerMIPSCompat::linkExitFrame()
{
uint8_t *dest = (uint8_t*)GetIonContext()->runtime->addressOfJitTop();
movePtr(ImmPtr(dest), ScratchRegister);
ma_sw(StackPointer, Address(ScratchRegister, 0));
}
void
MacroAssemblerMIPSCompat::linkParallelExitFrame(Register pt)
{
ma_sw(StackPointer, Address(pt, offsetof(PerThreadData, jitTop)));
}
// This macrosintruction calls the ion code and pushes the return address to
// the stack in the case when stack is alligned.
void

View File

@ -889,8 +889,6 @@ public:
ma_or(frameSizeReg, frameSizeReg, Imm32(type));
}
void linkExitFrame();
void linkParallelExitFrame(Register pt);
void handleFailureWithHandler(void *handler);
void handleFailureWithHandlerTail();

View File

@ -1301,12 +1301,6 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
orq(Imm32(type), frameSizeReg);
}
// Save an exit frame (which must be aligned to the stack pointer) to
// PerThreadData::jitTop of the main thread.
void linkExitFrame() {
storePtr(StackPointer, AbsoluteAddress(GetIonContext()->runtime->addressOfJitTop()));
}
void callWithExitFrame(JitCode *target, Register dynStack) {
addPtr(Imm32(framePushed()), dynStack);
makeFrameDescriptor(dynStack, JitFrame_IonJS);
@ -1314,12 +1308,6 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
call(target);
}
// Save an exit frame to the thread data of the current thread, given a
// register that holds a PerThreadData *.
void linkParallelExitFrame(Register pt) {
storePtr(StackPointer, Address(pt, offsetof(PerThreadData, jitTop)));
}
// See CodeGeneratorX64 calls to noteAsmJSGlobalAccess.
void patchAsmJSGlobalAccess(CodeOffsetLabel patchAt, uint8_t *code, uint8_t *globalData,
unsigned globalDataOffset)

View File

@ -1094,12 +1094,6 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
orl(Imm32(type), frameSizeReg);
}
// Save an exit frame (which must be aligned to the stack pointer) to
// PerThreadData::jitTop of the main thread.
void linkExitFrame() {
movl(StackPointer, Operand(AbsoluteAddress(GetIonContext()->runtime->addressOfJitTop())));
}
void callWithExitFrame(JitCode *target, Register dynStack) {
addPtr(Imm32(framePushed()), dynStack);
makeFrameDescriptor(dynStack, JitFrame_IonJS);
@ -1114,12 +1108,6 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
call(CallSiteDesc::Exit(), target);
}
// Save an exit frame to the thread data of the current thread, given a
// register that holds a PerThreadData *.
void linkParallelExitFrame(Register pt) {
movl(StackPointer, Operand(pt, offsetof(PerThreadData, jitTop)));
}
#ifdef JSGC_GENERATIONAL
void branchPtrInNurseryRange(Condition cond, Register ptr, Register temp, Label *label);
void branchValueIsNurseryObject(Condition cond, ValueOperand value, Register temp, Label *label);