Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index 9ea58d285b4f1257fb3cad2bd43d09162ad1a712..ae277b3feef9583f9a0ba6631d046faef73da9f9 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -1321,7 +1321,7 @@ void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
} |
-void FullCodeGenerator::EmitLoadGlobalCheckExtensions(Variable* var, |
+void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
TypeofState typeof_state, |
Label* slow) { |
Register context = rsi; |
@@ -1373,7 +1373,12 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(Variable* var, |
// All extension objects were empty and it is safe to use a global |
// load IC call. |
__ movp(LoadIC::ReceiverRegister(), GlobalObjectOperand()); |
- __ Move(LoadIC::NameRegister(), var->name()); |
+ __ Move(LoadIC::NameRegister(), proxy->var()->name()); |
+ if (FLAG_vector_ics) { |
+ __ Move(LoadIC::SlotRegister(), |
+ Smi::FromInt(proxy->VariableFeedbackSlot())); |
+ } |
+ |
ContextualMode mode = (typeof_state == INSIDE_TYPEOF) |
? NOT_CONTEXTUAL |
: CONTEXTUAL; |
@@ -1411,7 +1416,7 @@ MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
} |
-void FullCodeGenerator::EmitDynamicLookupFastCase(Variable* var, |
+void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy, |
TypeofState typeof_state, |
Label* slow, |
Label* done) { |
@@ -1420,8 +1425,9 @@ void FullCodeGenerator::EmitDynamicLookupFastCase(Variable* var, |
// introducing variables. In those cases, we do not want to |
// perform a runtime call for all variables in the scope |
// containing the eval. |
+ Variable* var = proxy->var(); |
if (var->mode() == DYNAMIC_GLOBAL) { |
- EmitLoadGlobalCheckExtensions(var, typeof_state, slow); |
+ EmitLoadGlobalCheckExtensions(proxy, typeof_state, slow); |
__ jmp(done); |
} else if (var->mode() == DYNAMIC_LOCAL) { |
Variable* local = var->local_if_not_shadowed(); |
@@ -1454,6 +1460,10 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { |
Comment cmnt(masm_, "[ Global variable"); |
__ Move(LoadIC::NameRegister(), var->name()); |
__ movp(LoadIC::ReceiverRegister(), GlobalObjectOperand()); |
+ if (FLAG_vector_ics) { |
+ __ Move(LoadIC::SlotRegister(), |
+ Smi::FromInt(proxy->VariableFeedbackSlot())); |
+ } |
CallLoadIC(CONTEXTUAL); |
context()->Plug(rax); |
break; |
@@ -1529,7 +1539,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { |
Label done, slow; |
// Generate code for loading from variables potentially shadowed |
// by eval-introduced variables. |
- EmitDynamicLookupFastCase(var, NOT_INSIDE_TYPEOF, &slow, &done); |
+ EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done); |
__ bind(&slow); |
__ Push(rsi); // Context. |
__ Push(var->name()); |
@@ -2055,6 +2065,10 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
// result = receiver[f](arg); |
__ bind(&l_call); |
__ movp(load_receiver, Operand(rsp, kPointerSize)); |
+ if (FLAG_vector_ics) { |
+ __ Move(LoadIC::SlotRegister(), |
+ Smi::FromInt(expr->KeyedLoadFeedbackSlot())); |
+ } |
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
CallIC(ic, TypeFeedbackId::None()); |
__ movp(rdi, rax); |
@@ -2070,6 +2084,9 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ Move(load_receiver, rax); |
__ Push(load_receiver); // save result |
__ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
+ if (FLAG_vector_ics) { |
+ __ Move(LoadIC::SlotRegister(), Smi::FromInt(expr->DoneFeedbackSlot())); |
+ } |
CallLoadIC(NOT_CONTEXTUAL); // rax=result.done |
Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
CallIC(bool_ic); |
@@ -2079,6 +2096,10 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
// result.value |
__ Pop(load_receiver); // result |
__ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" |
+ if (FLAG_vector_ics) { |
+ __ Move(LoadIC::SlotRegister(), |
+ Smi::FromInt(expr->ValueFeedbackSlot())); |
+ } |
CallLoadIC(NOT_CONTEXTUAL); // result.value in rax |
context()->DropAndPlug(2, rax); // drop iter and g |
break; |
@@ -2240,14 +2261,24 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
SetSourcePosition(prop->position()); |
Literal* key = prop->key()->AsLiteral(); |
__ Move(LoadIC::NameRegister(), key->value()); |
- CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); |
+ if (FLAG_vector_ics) { |
+ __ Move(LoadIC::SlotRegister(), Smi::FromInt(prop->PropertyFeedbackSlot())); |
+ CallLoadIC(NOT_CONTEXTUAL); |
+ } else { |
+ CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); |
+ } |
} |
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
SetSourcePosition(prop->position()); |
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
- CallIC(ic, prop->PropertyFeedbackId()); |
+ if (FLAG_vector_ics) { |
+ __ Move(LoadIC::SlotRegister(), Smi::FromInt(prop->PropertyFeedbackSlot())); |
+ CallIC(ic); |
+ } else { |
+ CallIC(ic, prop->PropertyFeedbackId()); |
+ } |
} |
@@ -2676,7 +2707,7 @@ void FullCodeGenerator::VisitCall(Call* expr) { |
{ PreservePositionScope scope(masm()->positions_recorder()); |
// Generate code for loading from variables potentially shadowed by |
// eval-introduced variables. |
- EmitDynamicLookupFastCase(proxy->var(), NOT_INSIDE_TYPEOF, &slow, &done); |
+ EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done); |
} |
__ bind(&slow); |
// Call the runtime to find the function to call (returned in rax) and |
@@ -4036,7 +4067,13 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
// Load the function from the receiver. |
__ movp(LoadIC::ReceiverRegister(), Operand(rsp, 0)); |
__ Move(LoadIC::NameRegister(), expr->name()); |
- CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); |
+ if (FLAG_vector_ics) { |
+ __ Move(LoadIC::SlotRegister(), |
+ Smi::FromInt(expr->CallRuntimeFeedbackSlot())); |
+ CallLoadIC(NOT_CONTEXTUAL); |
+ } else { |
+ CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); |
+ } |
// Push the target function under the receiver. |
__ Push(Operand(rsp, 0)); |
@@ -4377,6 +4414,10 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
Comment cmnt(masm_, "[ Global variable"); |
__ Move(LoadIC::NameRegister(), proxy->name()); |
__ movp(LoadIC::ReceiverRegister(), GlobalObjectOperand()); |
+ if (FLAG_vector_ics) { |
+ __ Move(LoadIC::SlotRegister(), |
+ Smi::FromInt(proxy->VariableFeedbackSlot())); |
+ } |
// Use a regular load, not a contextual load, to avoid a reference |
// error. |
CallLoadIC(NOT_CONTEXTUAL); |
@@ -4388,7 +4429,7 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
// Generate code for loading from variables potentially shadowed |
// by eval-introduced variables. |
- EmitDynamicLookupFastCase(proxy->var(), INSIDE_TYPEOF, &slow, &done); |
+ EmitDynamicLookupFastCase(proxy, INSIDE_TYPEOF, &slow, &done); |
__ bind(&slow); |
__ Push(rsi); |