Bug 1242462 - Allow IonMonkey re-enter until we reached the frequent bailout threshold. r=jandem
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Mon, 29 Feb 2016 13:20:37 +0000
changeset 322418 192d80d2d1def1fafcc9039eae4b021779f82639
parent 322417 ad1e7fdc44b303e0a1bfe0e546ace9e71192598a
child 322419 a9026a602088cda41dc9c4d5ebf045cfa5c9ee5a
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1242462
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1242462 - Allow IonMonkey re-enter until we reached the frequent bailout threshold. r=jandem
js/src/jit/Bailouts.cpp
js/src/jit/IonCode.h
--- a/js/src/jit/Bailouts.cpp
+++ b/js/src/jit/Bailouts.cpp
@@ -273,17 +273,17 @@ jit::EnsureHasScopeObjects(JSContext* cx
 void
 jit::CheckFrequentBailouts(JSContext* cx, JSScript* script, BailoutKind bailoutKind)
 {
     if (script->hasIonScript()) {
         // Invalidate if this script keeps bailing out without invalidation. Next time
         // we compile this script LICM will be disabled.
         IonScript* ionScript = script->ionScript();
 
-        if (ionScript->numBailouts() >= JitOptions.frequentBailoutThreshold) {
+        if (ionScript->bailoutExpected()) {
             // If we bailout because of the first execution of a basic block,
             // then we should record which basic block we are returning in,
             // which should prevent this from happening again.  Also note that
             // the first execution bailout can be related to an inlined script,
             // so there is no need to penalize the caller.
             if (bailoutKind != Bailout_FirstExecution && !script->hadFrequentBailouts())
                 script->setHadFrequentBailouts();
 
--- a/js/src/jit/IonCode.h
+++ b/js/src/jit/IonCode.h
@@ -413,21 +413,18 @@ struct IonScript
     }
     uint32_t invalidateEpilogueDataOffset() const {
         MOZ_ASSERT(invalidateEpilogueDataOffset_);
         return invalidateEpilogueDataOffset_;
     }
     void incNumBailouts() {
         numBailouts_++;
     }
-    uint32_t numBailouts() const {
-        return numBailouts_;
-    }
     bool bailoutExpected() const {
-        return numBailouts_ > 0;
+        return numBailouts_ >= JitOptions.frequentBailoutThreshold;
     }
     void setHasProfilingInstrumentation() {
         hasProfilingInstrumentation_ = true;
     }
     void clearHasProfilingInstrumentation() {
         hasProfilingInstrumentation_ = false;
     }
     bool hasProfilingInstrumentation() const {