Bug 1130481 - IonMonkey: Assert that Ion frames are properly aligned. r=bbouvier

This commit is contained in:
Nicolas B. Pierron 2015-02-12 14:53:06 +01:00
parent a3447ecae5
commit fb23b10b53
5 changed files with 14 additions and 3 deletions

View File

@ -2006,6 +2006,10 @@ CodeGenerator::visitOsrEntry(LOsrEntry *lir)
// to 0, before reserving the stack.
MOZ_ASSERT(masm.framePushed() == frameSize());
masm.setFramePushed(0);
// Ensure that the Ion frames is properly aligned.
masm.assertStackAlignment(JitStackAlignment, 0);
masm.reserveStack(frameSize());
}

View File

@ -3128,9 +3128,7 @@ AssertJitStackInvariants(JSContext *cx)
MOZ_RELEASE_ASSERT(frames.ionScript()->frameSize() % JitStackAlignment == 0,
"Ensure that if the Ion frame is aligned, then the spill base is also aligned");
InlineFrameIterator lastInlinedFrame(cx, &frames);
jsbytecode *pc = lastInlinedFrame.pc();
if (JSOp(*pc) == JSOP_FUNAPPLY) {
if (isScriptedCallee) {
MOZ_RELEASE_ASSERT(prevFrameSize % JitStackAlignment == 0,
"The ion frame should keep the alignment");
}

View File

@ -52,6 +52,9 @@ CodeGeneratorARM::generatePrologue()
if (isProfilerInstrumentationEnabled())
masm.profilerEnterFrame(StackPointer, CallTempReg0);
// Ensure that the Ion frames is properly aligned.
masm.assertStackAlignment(JitStackAlignment, 0);
// Note that this automatically sets MacroAssembler::framePushed().
masm.reserveStack(frameSize());
masm.checkStackAlignment();

View File

@ -49,6 +49,9 @@ CodeGeneratorMIPS::generatePrologue()
if (isProfilerInstrumentationEnabled())
masm.profilerEnterFrame(StackPointer, CallTempReg0);
// Ensure that the Ion frames is properly aligned.
masm.assertStackAlignment(JitStackAlignment, 0);
// Note that this automatically sets MacroAssembler::framePushed().
masm.reserveStack(frameSize());
masm.checkStackAlignment();

View File

@ -48,6 +48,9 @@ CodeGeneratorX86Shared::generatePrologue()
if (isProfilerInstrumentationEnabled())
masm.profilerEnterFrame(StackPointer, CallTempReg0);
// Ensure that the Ion frames is properly aligned.
masm.assertStackAlignment(JitStackAlignment, 0);
// Note that this automatically sets MacroAssembler::framePushed().
masm.reserveStack(frameSize());