Bug 1541404 part 17 - Fix InterpreterFrameInfo::popn to account for sizeof(Value). r=djvj
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 25 Apr 2019 12:49:34 +0000
changeset 530291 e8322e4b5e3cdb01ba1449fad87234ae0ed9e617
parent 530290 93d0a39116d4efb9ffc10135ff205ba0db55935a
child 530292 91925dfb453226613fdbbcad3222e990396b4bdc
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdjvj
bugs1541404
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1541404 part 17 - Fix InterpreterFrameInfo::popn to account for sizeof(Value). r=djvj Differential Revision: https://phabricator.services.mozilla.com/D28596
js/src/jit/BaselineFrameInfo.h
--- a/js/src/jit/BaselineFrameInfo.h
+++ b/js/src/jit/BaselineFrameInfo.h
@@ -367,17 +367,21 @@ class InterpreterFrameInfo : public Fram
   }
 
   void popRegsAndSync(uint32_t uses);
 
   void pop() { popn(1); }
 
   void popn(uint32_t n) { masm.addToStackPtr(Imm32(n * sizeof(Value))); }
 
-  void popn(Register reg) { masm.addToStackPtr(reg); }
+  void popn(Register reg) {
+    // sp := sp + reg * sizeof(Value)
+    Register spReg = AsRegister(masm.getStackPointer());
+    masm.computeEffectiveAddress(BaseValueIndex(spReg, reg), spReg);
+  }
 
   void popValue(ValueOperand dest) { masm.popValue(dest); }
 
   void push(const ValueOperand& val,
             JSValueType knownType = JSVAL_TYPE_UNKNOWN) {
     masm.pushValue(val);
   }
   void push(const Value& val) { masm.pushValue(val); }