Index: src/full-codegen/full-codegen.cc |
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc |
index 2c5d979cf1d3f3563d698a947af3da456eeb37d5..1900d955f5cae62a453ba2f0a4e08987bf6ac725 100644 |
--- a/src/full-codegen/full-codegen.cc |
+++ b/src/full-codegen/full-codegen.cc |
@@ -235,31 +235,37 @@ |
CallIC(ic, id); |
} |
-void FullCodeGenerator::CallStoreIC(TypeFeedbackId id) { |
- Handle<Code> ic = CodeFactory::StoreIC(isolate(), language_mode()).code(); |
+void FullCodeGenerator::CallStoreIC(FeedbackVectorSlot slot, |
+ Handle<Object> name, TypeFeedbackId id) { |
+ DCHECK(name->IsName()); |
+ __ Move(StoreDescriptor::NameRegister(), name); |
STATIC_ASSERT(!StoreDescriptor::kPassLastArgsOnStack || |
StoreDescriptor::kStackArgumentsCount == 2); |
if (StoreDescriptor::kPassLastArgsOnStack) { |
__ Push(StoreDescriptor::ValueRegister()); |
- __ Push(StoreDescriptor::SlotRegister()); |
- } |
- |
+ EmitPushSlot(slot); |
+ } else { |
+ EmitLoadSlot(StoreDescriptor::SlotRegister(), slot); |
+ } |
+ |
+ Handle<Code> ic = CodeFactory::StoreIC(isolate(), language_mode()).code(); |
CallIC(ic, id); |
RestoreContext(); |
} |
-void FullCodeGenerator::CallKeyedStoreIC() { |
- Handle<Code> ic = |
- CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
- |
+void FullCodeGenerator::CallKeyedStoreIC(FeedbackVectorSlot slot) { |
STATIC_ASSERT(!StoreDescriptor::kPassLastArgsOnStack || |
StoreDescriptor::kStackArgumentsCount == 2); |
if (StoreDescriptor::kPassLastArgsOnStack) { |
__ Push(StoreDescriptor::ValueRegister()); |
- __ Push(StoreDescriptor::SlotRegister()); |
- } |
- |
+ EmitPushSlot(slot); |
+ } else { |
+ EmitLoadSlot(StoreDescriptor::SlotRegister(), slot); |
+ } |
+ |
+ Handle<Code> ic = |
+ CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
CallIC(ic); |
RestoreContext(); |
} |
@@ -487,7 +493,6 @@ |
Comment cmnt(masm_, "[ VariableProxy"); |
EmitVariableLoad(expr); |
} |
- |
void FullCodeGenerator::VisitSloppyBlockFunctionStatement( |
SloppyBlockFunctionStatement* declaration) { |
@@ -1128,9 +1133,14 @@ |
PushOperand(result_register()); |
} |
-void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorSlot slot) { |
+void FullCodeGenerator::EmitLoadSlot(Register destination, |
+ FeedbackVectorSlot slot) { |
DCHECK(!slot.IsInvalid()); |
- __ Move(StoreDescriptor::SlotRegister(), SmiFromSlot(slot)); |
+ __ Move(destination, SmiFromSlot(slot)); |
+} |
+ |
+void FullCodeGenerator::EmitPushSlot(FeedbackVectorSlot slot) { |
+ __ Push(SmiFromSlot(slot)); |
} |
void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) { |