Bug 1033020 - Make BaslineFrame::returnValue match InterpreterFrame::returnValue; r=jandem
authorTerrence Cole <terrence@mozilla.com>
Tue, 01 Jul 2014 15:40:48 -0700
changeset 216885 c5e0699e4b50057da25e4695952c1c17076153bb
parent 216884 bdd82f1bf313def7be1a067b7b0b41d8f31911b8
child 216886 a79533c6430ca37e1cdc862e7ba8ae31f785c6d9
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1033020
milestone33.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 1033020 - Make BaslineFrame::returnValue match InterpreterFrame::returnValue; r=jandem
js/src/jit/BaselineFrame.h
js/src/vm/Stack.h
--- a/js/src/jit/BaselineFrame.h
+++ b/js/src/jit/BaselineFrame.h
@@ -218,21 +218,23 @@ class BaselineFrame
     }
 
     bool copyRawFrameSlots(AutoValueVector *vec) const;
 
     bool hasReturnValue() const {
         return flags_ & HAS_RVAL;
     }
     MutableHandleValue returnValue() {
-        return MutableHandleValue::fromMarkedLocation(reinterpret_cast<Value *>(&loReturnValue_));
+        if (!hasReturnValue())
+            addressOfReturnValue()->setUndefined();
+        return MutableHandleValue::fromMarkedLocation(addressOfReturnValue());
     }
     void setReturnValue(const Value &v) {
+        returnValue().set(v);
         flags_ |= HAS_RVAL;
-        returnValue().set(v);
     }
     inline Value *addressOfReturnValue() {
         return reinterpret_cast<Value *>(&loReturnValue_);
     }
 
     bool hasCallObj() const {
         return flags_ & HAS_CALL_OBJ;
     }
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -772,21 +772,21 @@ class InterpreterFrame
 
     void unsetPushedSPSFrame() {
         flags_ &= ~HAS_PUSHED_SPS_FRAME;
     }
 
     /* Return value */
 
     bool hasReturnValue() const {
-        return !!(flags_ & HAS_RVAL);
+        return flags_ & HAS_RVAL;
     }
 
     MutableHandleValue returnValue() {
-        if (!(flags_ & HAS_RVAL))
+        if (!hasReturnValue())
             rval_.setUndefined();
         return MutableHandleValue::fromMarkedLocation(&rval_);
     }
 
     void markReturnValue() {
         flags_ |= HAS_RVAL;
     }