Bug 933369 part 1 - Improve heuristics for Ion try-catch compilation. r=bhackett

This commit is contained in:
Jan de Mooij 2013-11-06 17:18:10 +01:00
parent 89be0a79ca
commit af5718205b
5 changed files with 11 additions and 19 deletions

View File

@ -205,11 +205,6 @@ jit::CheckFrequentBailouts(JSContext *cx, JSScript *script)
if (!Invalidate(cx, script))
return false;
} else {
// If we keep bailing out to handle exceptions, invalidate and
// forbid compilation.
if (ionScript->numExceptionBailouts() >= js_IonOptions.exceptionBailoutThreshold)
ForbidCompilation(cx, script);
}
}

View File

@ -1244,9 +1244,7 @@ jit::BailoutIonToBaseline(JSContext *cx, JitActivation *activation, IonBailoutIt
IonSpew(IonSpew_BaselineBailouts, " Reading from snapshot offset %u size %u",
iter.snapshotOffset(), iter.ionScript()->snapshotsSize());
if (excInfo)
iter.ionScript()->incNumExceptionBailouts();
else
if (!excInfo)
iter.ionScript()->incNumBailouts();
iter.script()->updateBaselineOrIonRaw();

View File

@ -711,7 +711,6 @@ IonScript::IonScript()
invalidateEpilogueOffset_(0),
invalidateEpilogueDataOffset_(0),
numBailouts_(0),
numExceptionBailouts_(0),
hasUncompiledCallTarget_(false),
hasSPSInstrumentation_(false),
runtimeData_(0),

View File

@ -190,10 +190,6 @@ struct IonScript
// Number of times this script bailed out without invalidation.
uint32_t numBailouts_;
// Number of times this scripted bailed out to enter a catch or
// finally block.
uint32_t numExceptionBailouts_;
// Flag set when it is likely that one of our (transitive) call
// targets is not compiled. Used in ForkJoin.cpp to decide when
// we should add call targets to the worklist.
@ -412,12 +408,6 @@ struct IonScript
bool bailoutExpected() const {
return numBailouts_ > 0;
}
void incNumExceptionBailouts() {
numExceptionBailouts_++;
}
uint32_t numExceptionBailouts() const {
return numExceptionBailouts_;
}
void setHasUncompiledCallTarget() {
hasUncompiledCallTarget_ = true;
}

View File

@ -363,6 +363,11 @@ HandleExceptionIon(JSContext *cx, const InlineFrameIterator &frame, ResumeFromEx
case JSTRY_CATCH:
if (cx->isExceptionPending()) {
// Ion can compile try-catch, but bailing out to catch
// exceptions is slow. Reset the use count so that if we
// catch many exceptions we won't Ion-compile the script.
script->resetUseCount();
// Bailout at the start of the catch block.
jsbytecode *catchPC = script->main() + tn->start + tn->length;
@ -477,6 +482,11 @@ HandleExceptionBaseline(JSContext *cx, const IonFrameIterator &frame, ResumeFrom
switch (tn->kind) {
case JSTRY_CATCH:
if (cx->isExceptionPending()) {
// Ion can compile try-catch, but bailing out to catch
// exceptions is slow. Reset the use count so that if we
// catch many exceptions we won't Ion-compile the script.
script->resetUseCount();
// Resume at the start of the catch block.
rfe->kind = ResumeFromException::RESUME_CATCH;
jsbytecode *catchPC = script->main() + tn->start + tn->length;