Bug 1182711 - Ensure usesScopeChain_ is true for heavyweight functions. r=bhackett
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 22 Jul 2015 13:36:16 +0200
changeset 254140 f083fd25e8faa0512d236064ab861ee0c053a800
parent 254139 a3b6daa308f2495ddb554fcd89a3eeeb284a3dbe
child 254141 3feab32e04177770ba2cef34928799d37876b33e
push id29090
push userryanvm@gmail.com
push dateWed, 22 Jul 2015 20:34:12 +0000
treeherdermozilla-central@8650fe82f1cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1182711
milestone42.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 1182711 - Ensure usesScopeChain_ is true for heavyweight functions. r=bhackett
js/src/jit/BytecodeAnalysis.cpp
--- a/js/src/jit/BytecodeAnalysis.cpp
+++ b/js/src/jit/BytecodeAnalysis.cpp
@@ -40,18 +40,20 @@ struct CatchFinallyRange
 };
 
 bool
 BytecodeAnalysis::init(TempAllocator& alloc, GSNCache& gsn)
 {
     if (!infos_.growByUninitialized(script_->length()))
         return false;
 
-    // We need a scope chain if any of the bindings are aliased.
-    usesScopeChain_ = script_->hasAnyAliasedBindings();
+    // We need a scope chain if the function is heavyweight.
+    usesScopeChain_ = (script_->functionDelazifying() &&
+                       script_->functionDelazifying()->isHeavyweight());
+    MOZ_ASSERT_IF(script_->hasAnyAliasedBindings(), usesScopeChain_);
 
     jsbytecode* end = script_->codeEnd();
 
     // Clear all BytecodeInfo.
     mozilla::PodZero(infos_.begin(), infos_.length());
     infos_[0].init(/*stackDepth=*/0);
 
     Vector<CatchFinallyRange, 0, JitAllocPolicy> catchFinallyRanges(alloc);