From ee63e441588e3ddbda87e8267c1fd014cfe28d8d Mon Sep 17 00:00:00 2001 From: Sean Stangl Date: Thu, 9 Jan 2014 15:32:51 -0800 Subject: [PATCH] Bug 958672 - Remove argslot from MCall LIR. r=h4writer --- js/src/jit/LIR-Common.h | 28 ++++++---------------------- js/src/jit/Lowering.cpp | 21 +++++++++------------ 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/js/src/jit/LIR-Common.h b/js/src/jit/LIR-Common.h index 73cd2c323a6..2852041e0f5 100644 --- a/js/src/jit/LIR-Common.h +++ b/js/src/jit/LIR-Common.h @@ -1004,17 +1004,9 @@ class LStackArgV : public LInstructionHelper<0, BOX_PIECES, 0> template class LJSCallInstructionHelper : public LCallInstructionHelper { - // Slot below which %esp should be adjusted to make the call. - // Zero for a function without arguments. - uint32_t argslot_; - public: - LJSCallInstructionHelper(uint32_t argslot) - : argslot_(argslot) - { } - uint32_t argslot() const { - return argslot_; + return mir()->numStackArgs(); } MCall *mir() const { return this->mir_->toCall(); @@ -1039,8 +1031,6 @@ class LJSCallInstructionHelper : public LCallInstructionHelpernumActualArgs(); } - - typedef LJSCallInstructionHelper JSCallHelper; }; // Generates a polymorphic callsite, wherein the function being called is @@ -1050,9 +1040,8 @@ class LCallGeneric : public LJSCallInstructionHelper public: LIR_HEADER(CallGeneric) - LCallGeneric(const LAllocation &func, uint32_t argslot, - const LDefinition &nargsreg, const LDefinition &tmpobjreg) - : JSCallHelper(argslot) + LCallGeneric(const LAllocation &func, const LDefinition &nargsreg, + const LDefinition &tmpobjreg) { setOperand(0, func); setTemp(0, nargsreg); @@ -1076,8 +1065,7 @@ class LCallKnown : public LJSCallInstructionHelper public: LIR_HEADER(CallKnown) - LCallKnown(const LAllocation &func, uint32_t argslot, const LDefinition &tmpobjreg) - : JSCallHelper(argslot) + LCallKnown(const LAllocation &func, const LDefinition &tmpobjreg) { setOperand(0, func); setTemp(0, tmpobjreg); @@ -1097,10 +1085,8 @@ class LCallNative : public LJSCallInstructionHelper public: LIR_HEADER(CallNative) - LCallNative(uint32_t argslot, - const LDefinition &argContext, const LDefinition &argUintN, + LCallNative(const LDefinition &argContext, const LDefinition &argUintN, const LDefinition &argVp, const LDefinition &tmpreg) - : JSCallHelper(argslot) { // Registers used for callWithABI(). setTemp(0, argContext); @@ -1131,10 +1117,8 @@ class LCallDOMNative : public LJSCallInstructionHelper public: LIR_HEADER(CallDOMNative) - LCallDOMNative(uint32_t argslot, - const LDefinition &argJSContext, const LDefinition &argObj, + LCallDOMNative(const LDefinition &argJSContext, const LDefinition &argObj, const LDefinition &argPrivate, const LDefinition &argArgs) - : JSCallHelper(argslot) { setTemp(0, argJSContext); setTemp(1, argObj); diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp index ee4daa5dc35..72918f63363 100644 --- a/js/src/jit/Lowering.cpp +++ b/js/src/jit/Lowering.cpp @@ -404,7 +404,6 @@ LIRGenerator::visitCall(MCall *call) return false; // Height of the current argument vector. - uint32_t argslot = call->numStackArgs(); JSFunction *target = call->getSingleTarget(); // Call DOM functions. @@ -416,10 +415,9 @@ LIRGenerator::visitCall(MCall *call) GetTempRegForIntArg(2, 0, &privReg); mozilla::DebugOnly ok = GetTempRegForIntArg(3, 0, &argsReg); MOZ_ASSERT(ok, "How can we not have four temp registers?"); - LCallDOMNative *lir = new(alloc()) LCallDOMNative(argslot, tempFixed(cxReg), - tempFixed(objReg), tempFixed(privReg), - tempFixed(argsReg)); - return (defineReturn(lir, call) && assignSafepoint(lir, call)); + LCallDOMNative *lir = new(alloc()) LCallDOMNative(tempFixed(cxReg), tempFixed(objReg), + tempFixed(privReg), tempFixed(argsReg)); + return defineReturn(lir, call) && assignSafepoint(lir, call); } // Call known functions. @@ -435,21 +433,20 @@ LIRGenerator::visitCall(MCall *call) mozilla::DebugOnly ok = GetTempRegForIntArg(3, 0, &tmpReg); MOZ_ASSERT(ok, "How can we not have four temp registers?"); - LCallNative *lir = new(alloc()) LCallNative(argslot, tempFixed(cxReg), - tempFixed(numReg), - tempFixed(vpReg), - tempFixed(tmpReg)); + LCallNative *lir = new(alloc()) LCallNative(tempFixed(cxReg), tempFixed(numReg), + tempFixed(vpReg), tempFixed(tmpReg)); return (defineReturn(lir, call) && assignSafepoint(lir, call)); } LCallKnown *lir = new(alloc()) LCallKnown(useFixed(call->getFunction(), CallTempReg0), - argslot, tempFixed(CallTempReg2)); - return (defineReturn(lir, call) && assignSafepoint(lir, call)); + tempFixed(CallTempReg2)); + return defineReturn(lir, call) && assignSafepoint(lir, call); } // Call anything, using the most generic code. LCallGeneric *lir = new(alloc()) LCallGeneric(useFixed(call->getFunction(), CallTempReg0), - argslot, tempFixed(ArgumentsRectifierReg), tempFixed(CallTempReg2)); + tempFixed(ArgumentsRectifierReg), + tempFixed(CallTempReg2)); return defineReturn(lir, call) && assignSafepoint(lir, call); }