зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1022891 - Part 3: Fix instantiating InlineFrameIterator from inside InlineFrameIterator when settled on a bailout frame. (r=nbp)
This commit is contained in:
Родитель
a09ed4d7c2
Коммит
d4bc71c172
|
@ -192,6 +192,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||||
: JitFrameIterator(activations),
|
: JitFrameIterator(activations),
|
||||||
machine_(frame.machineState())
|
machine_(frame.machineState())
|
||||||
{
|
{
|
||||||
|
kind_ = Kind_BailoutIterator;
|
||||||
returnAddressToFp_ = frame.returnAddressToFp();
|
returnAddressToFp_ = frame.returnAddressToFp();
|
||||||
topIonScript_ = frame.ionScript();
|
topIonScript_ = frame.ionScript();
|
||||||
const OsiIndex *osiIndex = frame.osiIndex();
|
const OsiIndex *osiIndex = frame.osiIndex();
|
||||||
|
|
|
@ -83,20 +83,23 @@ JitFrameIterator::JitFrameIterator(ThreadSafeContext *cx)
|
||||||
type_(JitFrame_Exit),
|
type_(JitFrame_Exit),
|
||||||
returnAddressToFp_(nullptr),
|
returnAddressToFp_(nullptr),
|
||||||
frameSize_(0),
|
frameSize_(0),
|
||||||
|
mode_(cx->isForkJoinContext() ? ParallelExecution : SequentialExecution),
|
||||||
|
kind_(Kind_FrameIterator),
|
||||||
cachedSafepointIndex_(nullptr),
|
cachedSafepointIndex_(nullptr),
|
||||||
activation_(nullptr),
|
activation_(nullptr)
|
||||||
mode_(cx->isForkJoinContext() ? ParallelExecution : SequentialExecution)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
JitFrameIterator::JitFrameIterator(const ActivationIterator &activations)
|
JitFrameIterator::JitFrameIterator(const ActivationIterator &activations)
|
||||||
: current_(activations.jitTop()),
|
: current_(activations.jitTop()),
|
||||||
type_(JitFrame_Exit),
|
type_(JitFrame_Exit),
|
||||||
returnAddressToFp_(nullptr),
|
returnAddressToFp_(nullptr),
|
||||||
frameSize_(0),
|
frameSize_(0),
|
||||||
cachedSafepointIndex_(nullptr),
|
mode_(activations->asJit()->cx()->isForkJoinContext() ? ParallelExecution
|
||||||
activation_(activations->asJit()),
|
: SequentialExecution),
|
||||||
mode_(activation_->cx()->isForkJoinContext() ? ParallelExecution : SequentialExecution)
|
kind_(Kind_FrameIterator),
|
||||||
|
cachedSafepointIndex_(nullptr),
|
||||||
|
activation_(activations->asJit())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,10 +108,25 @@ JitFrameIterator::JitFrameIterator(IonJSFrameLayout *fp, ExecutionMode mode)
|
||||||
type_(JitFrame_IonJS),
|
type_(JitFrame_IonJS),
|
||||||
returnAddressToFp_(fp->returnAddress()),
|
returnAddressToFp_(fp->returnAddress()),
|
||||||
frameSize_(fp->prevFrameLocalSize()),
|
frameSize_(fp->prevFrameLocalSize()),
|
||||||
mode_(mode)
|
mode_(mode),
|
||||||
|
kind_(Kind_FrameIterator)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IonBailoutIterator *
|
||||||
|
JitFrameIterator::asBailoutIterator()
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(isBailoutIterator());
|
||||||
|
return static_cast<IonBailoutIterator *>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
const IonBailoutIterator *
|
||||||
|
JitFrameIterator::asBailoutIterator() const
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(isBailoutIterator());
|
||||||
|
return static_cast<const IonBailoutIterator *>(this);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
JitFrameIterator::checkInvalidation() const
|
JitFrameIterator::checkInvalidation() const
|
||||||
{
|
{
|
||||||
|
@ -1761,7 +1779,11 @@ InlineFrameIterator::InlineFrameIterator(ThreadSafeContext *cx, const InlineFram
|
||||||
script_(cx)
|
script_(cx)
|
||||||
{
|
{
|
||||||
if (frame_) {
|
if (frame_) {
|
||||||
start_ = SnapshotIterator(*frame_);
|
if (frame_->isBailoutIterator())
|
||||||
|
start_ = SnapshotIterator(*frame_->asBailoutIterator());
|
||||||
|
else
|
||||||
|
start_ = SnapshotIterator(*frame_);
|
||||||
|
|
||||||
// findNextFrame will iterate to the next frame and init. everything.
|
// findNextFrame will iterate to the next frame and init. everything.
|
||||||
// Therefore to settle on the same frame, we report one frame less readed.
|
// Therefore to settle on the same frame, we report one frame less readed.
|
||||||
framesRead_ = iter->framesRead_ - 1;
|
framesRead_ = iter->framesRead_ - 1;
|
||||||
|
|
|
@ -76,6 +76,7 @@ enum ReadFrameArgsBehavior {
|
||||||
class IonCommonFrameLayout;
|
class IonCommonFrameLayout;
|
||||||
class IonJSFrameLayout;
|
class IonJSFrameLayout;
|
||||||
class IonExitFrameLayout;
|
class IonExitFrameLayout;
|
||||||
|
class IonBailoutIterator;
|
||||||
|
|
||||||
class BaselineFrame;
|
class BaselineFrame;
|
||||||
|
|
||||||
|
@ -88,11 +89,15 @@ class JitFrameIterator
|
||||||
FrameType type_;
|
FrameType type_;
|
||||||
uint8_t *returnAddressToFp_;
|
uint8_t *returnAddressToFp_;
|
||||||
size_t frameSize_;
|
size_t frameSize_;
|
||||||
|
ExecutionMode mode_;
|
||||||
|
enum Kind {
|
||||||
|
Kind_FrameIterator,
|
||||||
|
Kind_BailoutIterator
|
||||||
|
} kind_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable const SafepointIndex *cachedSafepointIndex_;
|
mutable const SafepointIndex *cachedSafepointIndex_;
|
||||||
const JitActivation *activation_;
|
const JitActivation *activation_;
|
||||||
ExecutionMode mode_;
|
|
||||||
|
|
||||||
void dumpBaseline() const;
|
void dumpBaseline() const;
|
||||||
|
|
||||||
|
@ -102,15 +107,22 @@ class JitFrameIterator
|
||||||
type_(JitFrame_Exit),
|
type_(JitFrame_Exit),
|
||||||
returnAddressToFp_(nullptr),
|
returnAddressToFp_(nullptr),
|
||||||
frameSize_(0),
|
frameSize_(0),
|
||||||
|
mode_(mode),
|
||||||
|
kind_(Kind_FrameIterator),
|
||||||
cachedSafepointIndex_(nullptr),
|
cachedSafepointIndex_(nullptr),
|
||||||
activation_(nullptr),
|
activation_(nullptr)
|
||||||
mode_(mode)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
explicit JitFrameIterator(ThreadSafeContext *cx);
|
explicit JitFrameIterator(ThreadSafeContext *cx);
|
||||||
explicit JitFrameIterator(const ActivationIterator &activations);
|
explicit JitFrameIterator(const ActivationIterator &activations);
|
||||||
explicit JitFrameIterator(IonJSFrameLayout *fp, ExecutionMode mode);
|
explicit JitFrameIterator(IonJSFrameLayout *fp, ExecutionMode mode);
|
||||||
|
|
||||||
|
bool isBailoutIterator() const {
|
||||||
|
return kind_ == Kind_BailoutIterator;
|
||||||
|
}
|
||||||
|
IonBailoutIterator *asBailoutIterator();
|
||||||
|
const IonBailoutIterator *asBailoutIterator() const;
|
||||||
|
|
||||||
// Current frame information.
|
// Current frame information.
|
||||||
FrameType type() const {
|
FrameType type() const {
|
||||||
return type_;
|
return type_;
|
||||||
|
@ -247,7 +259,6 @@ class JitFrameIterator
|
||||||
};
|
};
|
||||||
|
|
||||||
class IonJSFrameLayout;
|
class IonJSFrameLayout;
|
||||||
class IonBailoutIterator;
|
|
||||||
|
|
||||||
class RResumePoint;
|
class RResumePoint;
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||||
uint8_t *sp = bailout->parentStackPointer();
|
uint8_t *sp = bailout->parentStackPointer();
|
||||||
uint8_t *fp = sp + bailout->frameSize();
|
uint8_t *fp = sp + bailout->frameSize();
|
||||||
|
|
||||||
|
kind_ = Kind_BailoutIterator;
|
||||||
current_ = fp;
|
current_ = fp;
|
||||||
type_ = JitFrame_IonJS;
|
type_ = JitFrame_IonJS;
|
||||||
topFrameSize_ = current_ - sp;
|
topFrameSize_ = current_ - sp;
|
||||||
|
@ -112,6 +113,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||||
: JitFrameIterator(activations),
|
: JitFrameIterator(activations),
|
||||||
machine_(bailout->machine())
|
machine_(bailout->machine())
|
||||||
{
|
{
|
||||||
|
kind_ = Kind_BailoutIterator;
|
||||||
returnAddressToFp_ = bailout->osiPointReturnAddress();
|
returnAddressToFp_ = bailout->osiPointReturnAddress();
|
||||||
topIonScript_ = bailout->ionScript();
|
topIonScript_ = bailout->ionScript();
|
||||||
const OsiIndex *osiIndex = topIonScript_->getOsiIndex(returnAddressToFp_);
|
const OsiIndex *osiIndex = topIonScript_->getOsiIndex(returnAddressToFp_);
|
||||||
|
|
|
@ -20,6 +20,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||||
uint8_t *sp = bailout->parentStackPointer();
|
uint8_t *sp = bailout->parentStackPointer();
|
||||||
uint8_t *fp = sp + bailout->frameSize();
|
uint8_t *fp = sp + bailout->frameSize();
|
||||||
|
|
||||||
|
kind_ = Kind_BailoutIterator;
|
||||||
current_ = fp;
|
current_ = fp;
|
||||||
type_ = JitFrame_IonJS;
|
type_ = JitFrame_IonJS;
|
||||||
topFrameSize_ = current_ - sp;
|
topFrameSize_ = current_ - sp;
|
||||||
|
@ -56,6 +57,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||||
: JitFrameIterator(activations),
|
: JitFrameIterator(activations),
|
||||||
machine_(bailout->machine())
|
machine_(bailout->machine())
|
||||||
{
|
{
|
||||||
|
kind_ = Kind_BailoutIterator;
|
||||||
returnAddressToFp_ = bailout->osiPointReturnAddress();
|
returnAddressToFp_ = bailout->osiPointReturnAddress();
|
||||||
topIonScript_ = bailout->ionScript();
|
topIonScript_ = bailout->ionScript();
|
||||||
const OsiIndex *osiIndex = topIonScript_->getOsiIndex(returnAddressToFp_);
|
const OsiIndex *osiIndex = topIonScript_->getOsiIndex(returnAddressToFp_);
|
||||||
|
|
|
@ -53,6 +53,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||||
uint8_t *sp = bailout->parentStackPointer();
|
uint8_t *sp = bailout->parentStackPointer();
|
||||||
uint8_t *fp = sp + bailout->frameSize();
|
uint8_t *fp = sp + bailout->frameSize();
|
||||||
|
|
||||||
|
kind_ = Kind_BailoutIterator;
|
||||||
current_ = fp;
|
current_ = fp;
|
||||||
type_ = JitFrame_IonJS;
|
type_ = JitFrame_IonJS;
|
||||||
topFrameSize_ = current_ - sp;
|
topFrameSize_ = current_ - sp;
|
||||||
|
@ -69,6 +70,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||||
: JitFrameIterator(activations),
|
: JitFrameIterator(activations),
|
||||||
machine_(bailout->machine())
|
machine_(bailout->machine())
|
||||||
{
|
{
|
||||||
|
kind_ = Kind_BailoutIterator;
|
||||||
returnAddressToFp_ = bailout->osiPointReturnAddress();
|
returnAddressToFp_ = bailout->osiPointReturnAddress();
|
||||||
topIonScript_ = bailout->ionScript();
|
topIonScript_ = bailout->ionScript();
|
||||||
const OsiIndex *osiIndex = topIonScript_->getOsiIndex(returnAddressToFp_);
|
const OsiIndex *osiIndex = topIonScript_->getOsiIndex(returnAddressToFp_);
|
||||||
|
|
|
@ -73,6 +73,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||||
uint8_t *sp = bailout->parentStackPointer();
|
uint8_t *sp = bailout->parentStackPointer();
|
||||||
uint8_t *fp = sp + bailout->frameSize();
|
uint8_t *fp = sp + bailout->frameSize();
|
||||||
|
|
||||||
|
kind_ = Kind_BailoutIterator;
|
||||||
current_ = fp;
|
current_ = fp;
|
||||||
type_ = JitFrame_IonJS;
|
type_ = JitFrame_IonJS;
|
||||||
topFrameSize_ = current_ - sp;
|
topFrameSize_ = current_ - sp;
|
||||||
|
@ -109,6 +110,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||||
: JitFrameIterator(activations),
|
: JitFrameIterator(activations),
|
||||||
machine_(bailout->machine())
|
machine_(bailout->machine())
|
||||||
{
|
{
|
||||||
|
kind_ = Kind_BailoutIterator;
|
||||||
returnAddressToFp_ = bailout->osiPointReturnAddress();
|
returnAddressToFp_ = bailout->osiPointReturnAddress();
|
||||||
topIonScript_ = bailout->ionScript();
|
topIonScript_ = bailout->ionScript();
|
||||||
const OsiIndex *osiIndex = topIonScript_->getOsiIndex(returnAddressToFp_);
|
const OsiIndex *osiIndex = topIonScript_->getOsiIndex(returnAddressToFp_);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче