Bug 877826 - Make GetPcScript handle rectifier frames appropriately. r=jandem, a=lsblakk
authorKannan Vijayan <kvijayan@mozilla.com>
Thu, 11 Jul 2013 18:26:35 -0400
changeset 143540 587ed5a427232e8bafc53e8202973ebbe5a41495
parent 143539 31e38a93f1f049618d50c9d3901e3f566627794c
child 143541 f3d2f88ce8301ba74bd95cfa160c3bc2a8dc9389
push id3990
push userryanvm@gmail.com
push dateTue, 16 Jul 2013 14:20:03 +0000
treeherdermozilla-aurora@9c8e1fb423c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, lsblakk
bugs877826
milestone24.0a2
Bug 877826 - Make GetPcScript handle rectifier frames appropriately. r=jandem, a=lsblakk
js/src/ion/IonFrames.cpp
--- a/js/src/ion/IonFrames.cpp
+++ b/js/src/ion/IonFrames.cpp
@@ -1001,16 +1001,25 @@ GetPcScript(JSContext *cx, JSScript **sc
 {
     IonSpew(IonSpew_Snapshots, "Recover PC & Script from the last frame.");
 
     JSRuntime *rt = cx->runtime();
 
     // Recover the return address.
     IonFrameIterator it(rt->mainThread.ionTop);
 
+    // If the previous frame is a rectifier frame (maybe unwound),
+    // skip past it.
+    if (it.prevType() == IonFrame_Rectifier || it.prevType() == IonFrame_Unwound_Rectifier) {
+        ++it;
+        JS_ASSERT(it.prevType() == IonFrame_BaselineStub ||
+                  it.prevType() == IonFrame_BaselineJS ||
+                  it.prevType() == IonFrame_OptimizedJS);
+    }
+
     // If the previous frame is a stub frame, skip the exit frame so that
     // returnAddress below gets the return address into the BaselineJS
     // frame.
     if (it.prevType() == IonFrame_BaselineStub || it.prevType() == IonFrame_Unwound_BaselineStub) {
         ++it;
         JS_ASSERT(it.prevType() == IonFrame_BaselineJS);
     }