Bug 1163207 - Make RematerializedFrame store the real callee. (r=shu)
☠☠ backed out by 03e1398dea10 ☠ ☠
authorEric Faust <efaustbmo@mozilla.com>
Thu, 14 May 2015 21:15:44 -0700
changeset 245234 8316f8e3953d1320d833634c73c9f0589de8cdb5
parent 245233 6fe131387fb250df3042545b0b7e839265286622
child 245235 908a2f7972f5d9ff10bab8bbec3eeecfc24004d0
push id60139
push userefaustbmo@gmail.com
push dateFri, 22 May 2015 20:13:34 +0000
treeherdermozilla-inbound@95f9ab2b60e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1163207
milestone41.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 1163207 - Make RematerializedFrame store the real callee. (r=shu)
js/src/jit/RematerializedFrame.cpp
js/src/jit/RematerializedFrame.h
--- a/js/src/jit/RematerializedFrame.cpp
+++ b/js/src/jit/RematerializedFrame.cpp
@@ -36,16 +36,21 @@ RematerializedFrame::RematerializedFrame
   : prevUpToDate_(false),
     isDebuggee_(iter.script()->isDebuggee()),
     top_(top),
     pc_(iter.pc()),
     frameNo_(iter.frameNo()),
     numActualArgs_(numActualArgs),
     script_(iter.script())
 {
+    if (iter.isFunctionFrame())
+        callee_ = iter.callee(fallback);
+    else
+        callee_ = nullptr;
+
     CopyValueToRematerializedFrame op(slots_);
     iter.readFrameArgsAndLocals(cx, op, op, &scopeChain_, &hasCallObj_, &returnValue_,
                                 &argsObj_, &thisValue_, ReadFrame_Actuals,
                                 fallback);
 }
 
 /* static */ RematerializedFrame*
 RematerializedFrame::New(JSContext* cx, uint8_t* top, InlineFrameIterator& iter,
@@ -144,16 +149,17 @@ RematerializedFrame::initFunctionScopeOb
     return true;
 }
 
 void
 RematerializedFrame::mark(JSTracer* trc)
 {
     TraceRoot(trc, &script_, "remat ion frame script");
     TraceRoot(trc, &scopeChain_, "remat ion frame scope chain");
+    TraceRoot(trc, &callee_, "remat ion frame callee");
     TraceRoot(trc, &returnValue_, "remat ion frame return value");
     TraceRoot(trc, &thisValue_, "remat ion frame this");
     TraceRootRange(trc, numActualArgs_ + script_->nfixed(), slots_, "remat ion frame stack");
 }
 
 void
 RematerializedFrame::dump()
 {
--- a/js/src/jit/RematerializedFrame.h
+++ b/js/src/jit/RematerializedFrame.h
@@ -38,16 +38,17 @@ class RematerializedFrame
     // The bytecode at the time of rematerialization.
     jsbytecode* pc_;
 
     size_t frameNo_;
     unsigned numActualArgs_;
 
     JSScript* script_;
     JSObject* scopeChain_;
+    JSFunction* callee_;
     ArgumentsObject* argsObj_;
 
     Value returnValue_;
     Value thisValue_;
     Value slots_[1];
 
     RematerializedFrame(JSContext* cx, uint8_t* top, unsigned numActualArgs,
                         InlineFrameIterator& iter, MaybeReadFallback& fallback);
@@ -146,20 +147,21 @@ class RematerializedFrame
     JSFunction* fun() const {
         MOZ_ASSERT(isFunctionFrame());
         return script_->functionNonDelazifying();
     }
     JSFunction* maybeFun() const {
         return isFunctionFrame() ? fun() : nullptr;
     }
     JSFunction* callee() const {
-        return fun();
+        MOZ_ASSERT(isFunctionFrame());
+        return callee_;
     }
     Value calleev() const {
-        return ObjectValue(*fun());
+        return ObjectValue(*callee());
     }
     Value& thisValue() {
         return thisValue_;
     }
 
     unsigned numFormalArgs() const {
         return maybeFun() ? fun()->nargs() : 0;
     }