Bug 1070962 part 5 - rematerializeFrames no longer use IonBailoutIterator. r=jandem
--- 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