Bug 806206 - InlineFrameIterator: provide default scope chain value if unused. r=dvander, a=bajaj
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Wed, 09 Jan 2013 22:16:50 -0800
changeset 127086 28a906b30f5950906ab57de6000eb0c70e6c8245
parent 127085 ead7d8638f1552ae4e73f53babc03e639225e048
child 127087 a2d6688690339b3f3d797879117736a03c87c036
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, bajaj
bugs806206
milestone20.0a2
Bug 806206 - InlineFrameIterator: provide default scope chain value if unused. r=dvander, a=bajaj
js/src/ion/IonFrames.cpp
--- a/js/src/ion/IonFrames.cpp
+++ b/js/src/ion/IonFrames.cpp
@@ -1037,18 +1037,22 @@ IonFrameIterator::isConstructing() const
 
 JSObject *
 InlineFrameIterator::scopeChain() const
 {
     SnapshotIterator s(si_);
 
     // scopeChain
     Value v = s.read();
-    JS_ASSERT(v.isObject());
-    return &v.toObject();
+    if (v.isObject()) {
+        JS_ASSERT_IF(script()->hasAnalysis(), script()->analysis()->usesScopeChain());
+        return &v.toObject();
+    }
+
+    return callee()->environment();
 }
 
 JSObject *
 InlineFrameIterator::thisObject() const
 {
     // JS_ASSERT(isConstructing(...));
     SnapshotIterator s(si_);