Don't place a pool in the middle of a C call (bug 696748, r=dmandelin)

This commit is contained in:
Marty Rosenberg 2011-11-30 17:57:30 -08:00
parent f15bef0f8e
commit 98b6461eb2

View File

@ -560,6 +560,16 @@ static const JSC::MacroAssembler::RegisterID JSParamReg_Argc = JSC::SparcRegist
//
// After callWithABI(), the call state is reset, so a new call may begin.
Call callWithABI(void *fun, bool canThrow) {
#ifdef JS_CPU_ARM
// the repatcher requires that these instructions are adjacent in
// memory, make sure that they are in fact adjacent.
// Theoretically, this requires only 12 bytes of space, however
// there are at least a couple of off-by-one errors that I've noticed
// that make 12 insufficent. In case 16 is also insufficent, I've bumped
// it to 20.
ensureSpace(20);
int initFlushCount = flushCount();
#endif
// [Bug 614953]: This can only be made conditional once the ARM back-end
// is able to distinguish and patch both call sequences. Other
// architecutres are unaffected regardless.
@ -574,7 +584,9 @@ static const JSC::MacroAssembler::RegisterID JSParamReg_Argc = JSC::SparcRegist
Call cl = call();
callPatches.append(CallPatch(cl, fun));
#ifdef JS_CPU_ARM
JS_ASSERT(initFlushCount == flushCount());
#endif
if (stackAdjust)
addPtr(Imm32(stackAdjust), stackPointerRegister);