Bug 996533 - Add some BaselineScript/IonScript asserts. r=till

This commit is contained in:
Jan de Mooij 2014-04-15 13:24:42 +02:00
parent ee2c3eec19
commit edc1a91edc
4 changed files with 13 additions and 2 deletions

View File

@ -482,6 +482,8 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
AutoValueVector &startFrameFormals, MutableHandleFunction nextCallee,
jsbytecode **callPC, const ExceptionBailoutInfo *excInfo)
{
MOZ_ASSERT(script->hasBaselineScript());
// If excInfo is non-nullptr, we are bailing out to a catch or finally block
// and this is the frame where we will resume. Usually the expression stack
// should be empty in this case but there can be iterators on the stack.
@ -1544,6 +1546,7 @@ jit::FinishBailoutToBaseline(BaselineBailoutInfo *bailoutInfo)
if (iter.isBaselineJS()) {
BaselineFrame *frame = iter.baselineFrame();
MOZ_ASSERT(frame->script()->hasBaselineScript());
// If the frame doesn't even have a scope chain set yet, then it's resuming
// into the the prologue before the scope chain is initialized. Any

View File

@ -1594,6 +1594,7 @@ InlineFrameIteratorMaybeGC<allowGC>::findNextFrame()
// Read the initial frame out of the C stack.
callee_ = frame_->maybeCallee();
script_ = frame_->script();
MOZ_ASSERT(script_->hasBaselineScript());
// Settle on the outermost frame without evaluating any instructions before
// looking for a pc.
@ -1652,6 +1653,7 @@ InlineFrameIteratorMaybeGC<allowGC>::findNextFrame()
// for the executed script, if they are clones. The actual script
// exists though, just make sure the function points to it.
script_ = callee_->existingScript();
MOZ_ASSERT(script_->hasBaselineScript());
pc_ = script_->offsetToPC(si_.pcOffset());
}

View File

@ -1167,7 +1167,9 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
}
bool hasIonScript() const {
return ion && ion != ION_DISABLED_SCRIPT && ion != ION_COMPILING_SCRIPT;
bool res = ion && ion != ION_DISABLED_SCRIPT && ion != ION_COMPILING_SCRIPT;
MOZ_ASSERT_IF(res, baseline);
return res;
}
bool canIonCompile() const {
return ion != ION_DISABLED_SCRIPT;
@ -1191,11 +1193,14 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
if (hasIonScript())
js::jit::IonScript::writeBarrierPre(tenuredZone(), ion);
ion = ionScript;
MOZ_ASSERT_IF(hasIonScript(), hasBaselineScript());
updateBaselineOrIonRaw();
}
bool hasBaselineScript() const {
return baseline && baseline != BASELINE_DISABLED_SCRIPT;
bool res = baseline && baseline != BASELINE_DISABLED_SCRIPT;
MOZ_ASSERT_IF(!res, !ion || ion == ION_DISABLED_SCRIPT);
return res;
}
bool canBaselineCompile() const {
return baseline != BASELINE_DISABLED_SCRIPT;

View File

@ -168,6 +168,7 @@ JSScript::setBaselineScript(JSContext *maybecx, js::jit::BaselineScript *baselin
if (hasBaselineScript())
js::jit::BaselineScript::writeBarrierPre(tenuredZone(), baseline);
#endif
MOZ_ASSERT(!hasIonScript());
baseline = baselineScript;
updateBaselineOrIonRaw();
}