Bug 1344195 - Fix CloneOldBaselineStub to not clone the stub if we didn't recompile the script. r=shu
authorJan de Mooij <jdemooij@mozilla.com>
Sat, 04 Mar 2017 15:35:39 +0100
changeset 394999 63d05802b98a6d251937b9965294a290c63ea7f5
parent 394998 c87ea81036b79a6f852d9e62659d922fa6d387d1
child 395000 ba5e3b0a356e7bf1e5e4c73c2e35b0299eb90752
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1344195
milestone54.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 1344195 - Fix CloneOldBaselineStub to not clone the stub if we didn't recompile the script. r=shu
js/src/jit/BaselineDebugModeOSR.cpp
--- a/js/src/jit/BaselineDebugModeOSR.cpp
+++ b/js/src/jit/BaselineDebugModeOSR.cpp
@@ -707,16 +707,23 @@ CloneOldBaselineStub(JSContext* cx, Debu
 {
     DebugModeOSREntry& entry = entries[entryIndex];
     if (!entry.oldStub)
         return true;
 
     ICStub* oldStub = entry.oldStub;
     MOZ_ASSERT(oldStub->makesGCCalls());
 
+    // If this script was not recompiled (because it already had the correct
+    // debug instrumentation), don't clone to avoid attaching duplicate stubs.
+    if (!entry.recompiled()) {
+        entry.newStub = nullptr;
+        return true;
+    }
+
     if (entry.frameKind == ICEntry::Kind_Invalid) {
         // The exception handler can modify the frame's override pc while
         // unwinding scopes. This is fine, but if we have a stub frame, the code
         // code below will get confused: the entry's pcOffset doesn't match the
         // stub that's still on the stack. To prevent that, we just set the new
         // stub to nullptr as we will never return to this stub frame anyway.
         entry.newStub = nullptr;
         return true;