Bug 877826 - Make GetPcScript handle rectifier frames appropriately. r=jandem
authorKannan Vijayan <kvijayan@mozilla.com>
Thu, 11 Jul 2013 18:26:35 -0400
changeset 138249 cad670b92cfe544015ad1695fe3e85f048001960
parent 138248 e12f7eb2b997387b800901f927023dc520062fdd
child 138250 16e818a5835758d07a8c197b90f645f139255936
push id24949
push userryanvm@gmail.com
push dateFri, 12 Jul 2013 17:29:41 +0000
treeherdermozilla-central@f2d3b5149d3a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs877826
milestone25.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 877826 - Make GetPcScript handle rectifier frames appropriately. r=jandem
js/src/ion/IonFrames.cpp
--- a/js/src/ion/IonFrames.cpp
+++ b/js/src/ion/IonFrames.cpp
@@ -1044,16 +1044,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);
     }