Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: src/full-codegen/full-codegen.cc

Issue 2363513003: [fullcodegen] Refactor code that calls store ICs. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 @@ void FullCodeGenerator::CallLoadGlobalIC(TypeofMode typeof_mode,
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();
}
@@ -488,7 +494,6 @@ void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
EmitVariableLoad(expr);
}
-
void FullCodeGenerator::VisitSloppyBlockFunctionStatement(
SloppyBlockFunctionStatement* declaration) {
Visit(declaration->statement());
@@ -1128,9 +1133,14 @@ void FullCodeGenerator::EmitPropertyKey(LiteralProperty* property,
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) {
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698