Bug 1070962 - Part 5: RematerializeFrames no longer use IonBailoutIterator. r=jandem, a=abillings
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Mon, 13 Oct 2014 17:34:01 +0200
changeset 234746 2c3df43383cb59c50fd90a881413773cca2570e5
parent 234745 59bf3da9cb79c1e6bf3f6de3f68f6c09b1397a34
child 234747 7ec4746b298c0fdc2049c4a0f8fa6080e233b9f1
push id611
push userraliiev@mozilla.com
push dateMon, 05 Jan 2015 23:23:16 +0000
treeherdermozilla-release@345cd3b9c445 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, abillings
bugs1070962
milestone35.0a2
Bug 1070962 - Part 5: RematerializeFrames no longer use IonBailoutIterator. r=jandem, a=abillings
js/src/jit/Bailouts.h
js/src/jit/ParallelFunctions.cpp
js/src/vm/ForkJoin.cpp
js/src/vm/ForkJoin.h
--- a/js/src/jit/Bailouts.h
+++ b/js/src/jit/Bailouts.h
@@ -143,23 +143,17 @@ class IonBailoutIterator : public JitFra
         return topFrameSize_;
     }
     IonScript *ionScript() const {
         if (topIonScript_)
             return topIonScript_;
         return JitFrameIterator::ionScript();
     }
 
-    IonBailoutIterator &operator++() {
-        JitFrameIterator::operator++();
-        // Clear topIonScript_ now that we've advanced past it, so that
-        // snapshotOffset() and machineState() reflect the current script.
-        topIonScript_ = nullptr;
-        return *this;
-    }
+    IonBailoutIterator &operator++() MOZ_DELETE;
 
     void dump() const;
 };
 
 bool EnsureHasScopeObjects(JSContext *cx, AbstractFramePtr fp);
 
 struct BaselineBailoutInfo;
 
--- a/js/src/jit/ParallelFunctions.cpp
+++ b/js/src/jit/ParallelFunctions.cpp
@@ -539,19 +539,20 @@ jit::BailoutPar(BailoutStack *sp, uint8_
 
     // We don't have an exit frame.
     MOZ_ASSERT(IsInRange(FAKE_JIT_TOP_FOR_BAILOUT, 0, 0x1000) &&
                IsInRange(FAKE_JIT_TOP_FOR_BAILOUT + sizeof(IonCommonFrameLayout), 0, 0x1000),
                "Fake jitTop pointer should be within the first page.");
     cx->perThreadData->jitTop = FAKE_JIT_TOP_FOR_BAILOUT;
 
     JitActivationIterator jitActivations(cx->perThreadData);
-    IonBailoutIterator frameIter(jitActivations, sp);
+    IonBailoutIterator bailoutData(jitActivations, sp);
+    JitActivation::RegisterBailoutIterator registerIterator(*jitActivations->asJit(), &bailoutData);
+    JitFrameIterator frameIter(jitActivations);
     SnapshotIterator snapIter(frameIter);
-    JitActivation::RegisterBailoutIterator registerIterator(*jitActivations->asJit(), &frameIter);
 
     cx->bailoutRecord->setIonBailoutKind(snapIter.bailoutKind());
     cx->bailoutRecord->rematerializeFrames(cx, frameIter);
 
     MOZ_ASSERT(frameIter.done());
     *entryFramePointer = frameIter.fp();
 }
 
--- a/js/src/vm/ForkJoin.cpp
+++ b/js/src/vm/ForkJoin.cpp
@@ -1876,66 +1876,51 @@ ParallelBailoutRecord::init(JSContext *c
 
 void
 ParallelBailoutRecord::reset()
 {
     RematerializedFrame::FreeInVector(frames());
     cause = ParallelBailoutNone;
 }
 
-template <class T>
-static void
-RematerializeFramesWithIter(ForkJoinContext *cx, T &frameIter,
-                            Vector<RematerializedFrame *> &frames)
+void
+ParallelBailoutRecord::rematerializeFrames(ForkJoinContext *cx, JitFrameIterator &frameIter)
 {
-    // This function as well as |rematerializeFrames| methods below are
-    // infallible. These are only called when we are already erroring out. If
-    // we OOM here, free what we've allocated and return. Error reporting is
-    // then unable to give the user detailed stack information.
+    // This function is infallible. These are only called when we are already
+    // erroring out. If we OOM here, free what we've allocated and return. Error
+    // reporting is then unable to give the user detailed stack information.
 
-    MOZ_ASSERT(frames.empty());
+    MOZ_ASSERT(frames().empty());
 
     for (; !frameIter.done(); ++frameIter) {
         if (!frameIter.isIonJS())
             continue;
 
         InlineFrameIterator inlineIter(cx, &frameIter);
         Vector<RematerializedFrame *> inlineFrames(cx);
 
         if (!RematerializedFrame::RematerializeInlineFrames(cx, frameIter.fp(),
                                                             inlineIter, inlineFrames))
         {
             RematerializedFrame::FreeInVector(inlineFrames);
-            RematerializedFrame::FreeInVector(frames);
+            RematerializedFrame::FreeInVector(frames());
             return;
         }
 
         // Reverse the inline frames into the main vector.
         while (!inlineFrames.empty()) {
-            if (!frames.append(inlineFrames.popCopy())) {
+            if (!frames().append(inlineFrames.popCopy())) {
                 RematerializedFrame::FreeInVector(inlineFrames);
-                RematerializedFrame::FreeInVector(frames);
+                RematerializedFrame::FreeInVector(frames());
                 return;
             }
         }
     }
 }
 
-void
-ParallelBailoutRecord::rematerializeFrames(ForkJoinContext *cx, JitFrameIterator &frameIter)
-{
-    RematerializeFramesWithIter(cx, frameIter, frames());
-}
-
-void
-ParallelBailoutRecord::rematerializeFrames(ForkJoinContext *cx, IonBailoutIterator &frameIter)
-{
-    RematerializeFramesWithIter(cx, frameIter, frames());
-}
-
 //////////////////////////////////////////////////////////////////////////////
 
 //
 // Debug spew
 //
 
 #ifdef FORKJOIN_SPEW
 
--- a/js/src/vm/ForkJoin.h
+++ b/js/src/vm/ForkJoin.h
@@ -368,17 +368,16 @@ struct ParallelBailoutRecord
     }
 
     void setIonBailoutKind(jit::BailoutKind kind) {
         joinCause(ParallelBailoutExecution);
         ionBailoutKind = kind;
     }
 
     void rematerializeFrames(ForkJoinContext *cx, jit::JitFrameIterator &frameIter);
-    void rematerializeFrames(ForkJoinContext *cx, jit::IonBailoutIterator &frameIter);
 };
 
 class ForkJoinShared;
 
 class ForkJoinContext : public ThreadSafeContext
 {
   public:
     // Bailout record used to record the reason this thread stopped executing