Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 0ea1bd59bd42890451fd6de40e34dbe43335e9c9..e15e40e534f07c4cef6ab04ec75f6d1aef8a2be8 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -5407,11 +5407,8 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { |
variable->name(), |
ast_context()->is_for_typeof()); |
if (FLAG_vector_ics) { |
- Handle<SharedFunctionInfo> current_shared = |
- function_state()->compilation_info()->shared_info(); |
- instr->SetVectorAndSlot( |
- handle(current_shared->feedback_vector(), isolate()), |
- expr->VariableFeedbackSlot()); |
+ instr->SetVectorAndSlot(handle(current_feedback_vector(), isolate()), |
+ expr->VariableFeedbackSlot()); |
} |
return ast_context()->ReturnInstruction(instr, expr->id()); |
} |
@@ -6902,10 +6899,8 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric( |
HLoadNamedGeneric* result = |
New<HLoadNamedGeneric>(object, name, PREMONOMORPHIC); |
if (FLAG_vector_ics) { |
- Handle<SharedFunctionInfo> current_shared = |
- function_state()->compilation_info()->shared_info(); |
Handle<TypeFeedbackVector> vector = |
- handle(current_shared->feedback_vector(), isolate()); |
+ handle(current_feedback_vector(), isolate()); |
FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); |
result->SetVectorAndSlot(vector, slot); |
} |
@@ -6925,13 +6920,17 @@ HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric( |
HValue* key, |
HValue* value) { |
if (access_type == LOAD) { |
+ InlineCacheState initial_state = |
+ FLAG_vector_ics ? expr->AsProperty()->GetInlineCacheState() |
+ : PREMONOMORPHIC; |
HLoadKeyedGeneric* result = |
- New<HLoadKeyedGeneric>(object, key, PREMONOMORPHIC); |
- if (FLAG_vector_ics) { |
- Handle<SharedFunctionInfo> current_shared = |
- function_state()->compilation_info()->shared_info(); |
+ New<HLoadKeyedGeneric>(object, key, initial_state); |
+ // HLoadKeyedGeneric with vector ics benefits from being encoded as |
+ // MEGAMORPHIC because the vector/slot combo becomes unnecessary. |
+ if (initial_state != MEGAMORPHIC) { |
+ // We need to pass vector information. |
Handle<TypeFeedbackVector> vector = |
- handle(current_shared->feedback_vector(), isolate()); |
+ handle(current_feedback_vector(), isolate()); |
FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot(); |
result->SetVectorAndSlot(vector, slot); |
} |
@@ -9316,10 +9315,8 @@ void HOptimizedGraphBuilder::VisitCall(Call* expr) { |
expr->IsUsingCallFeedbackICSlot(isolate())) { |
// We've never seen this call before, so let's have Crankshaft learn |
// through the type vector. |
- Handle<SharedFunctionInfo> current_shared = |
- function_state()->compilation_info()->shared_info(); |
Handle<TypeFeedbackVector> vector = |
- handle(current_shared->feedback_vector(), isolate()); |
+ handle(current_feedback_vector(), isolate()); |
FeedbackVectorICSlot slot = expr->CallFeedbackICSlot(); |
call_function->SetVectorAndSlot(vector, slot); |
} |