Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index 8d2d2146247f7b93f5387cf8625d8fe7da0f3a92..bca151bf62c021a64fec9e238593e4c138a22c30 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -12336,7 +12336,8 @@ void HOptimizedGraphBuilder::VisitDeclarations( |
isolate()->factory()->NewFixedArray(globals_.length(), TENURED); |
for (int i = 0; i < globals_.length(); ++i) array->set(i, *globals_.at(i)); |
int flags = current_info()->GetDeclareGlobalsFlags(); |
- Add<HDeclareGlobals>(array, flags); |
+ Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate()); |
+ Add<HDeclareGlobals>(array, flags, vector); |
globals_.Rewind(0); |
} |
} |
@@ -12350,11 +12351,14 @@ void HOptimizedGraphBuilder::VisitVariableDeclaration( |
bool hole_init = mode == LET || mode == CONST; |
switch (variable->location()) { |
case VariableLocation::GLOBAL: |
- case VariableLocation::UNALLOCATED: |
+ case VariableLocation::UNALLOCATED: { |
DCHECK(!variable->binding_needs_init()); |
- globals_.Add(variable->name(), zone()); |
+ FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
+ DCHECK(!slot.IsInvalid()); |
+ globals_.Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
globals_.Add(isolate()->factory()->undefined_value(), zone()); |
return; |
+ } |
case VariableLocation::PARAMETER: |
case VariableLocation::LOCAL: |
if (hole_init) { |
@@ -12386,7 +12390,9 @@ void HOptimizedGraphBuilder::VisitFunctionDeclaration( |
switch (variable->location()) { |
case VariableLocation::GLOBAL: |
case VariableLocation::UNALLOCATED: { |
- globals_.Add(variable->name(), zone()); |
+ FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
+ 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. |