Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index 1ddc4a80b60b51239e74ccc0b4d4930f62c0aa89..925039f2602b4696a217a7fc9ed78360e245a8e9 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -11848,6 +11848,7 @@ void HOptimizedGraphBuilder::VisitVariableDeclaration( |
DCHECK(!slot.IsInvalid()); |
globals_.Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
globals_.Add(isolate()->factory()->undefined_value(), zone()); |
+ globals_.Add(isolate()->factory()->undefined_value(), zone()); |
return; |
} |
case VariableLocation::PARAMETER: |
@@ -11886,6 +11887,12 @@ void HOptimizedGraphBuilder::VisitFunctionDeclaration( |
FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
DCHECK(!slot.IsInvalid()); |
globals_.Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
+ |
+ // We need the slot where the literals array lives, too. |
+ slot = declaration->fun()->LiteralFeedbackSlot(); |
+ DCHECK(!slot.IsInvalid()); |
+ globals_.Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
+ |
Handle<SharedFunctionInfo> function = Compiler::GetSharedFunctionInfo( |
declaration->fun(), current_info()->script(), top_info()); |
// Check for stack-overflow exception. |