diff --git a/js/src/jit/BytecodeAnalysis.cpp b/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);
