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

Unified Diff: src/ic/handler-configuration-inl.h

Issue 2438553003: [ic] Support data handlers that represent simple field stores. (Closed)
Patch Set: One more fix for GC stress issues Created 4 years, 2 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/ic/handler-configuration.h ('k') | src/ic/ic.cc » ('j') | src/ic/ic.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/handler-configuration-inl.h
diff --git a/src/ic/handler-configuration-inl.h b/src/ic/handler-configuration-inl.h
index 7e7eec4f156ca12444d1677559615be3fde854ed..832a5e4f7abc9e96700e8895ce9fd54007a404e9 100644
--- a/src/ic/handler-configuration-inl.h
+++ b/src/ic/handler-configuration-inl.h
@@ -40,6 +40,37 @@ Handle<Object> LoadHandler::LoadElement(Isolate* isolate,
return handle(Smi::FromInt(config), isolate);
}
+Handle<Object> StoreHandler::StoreField(Isolate* isolate, int descriptor,
+ FieldIndex field_index,
+ Representation representation) {
+ StoreHandler::FieldRepresentation field_rep;
+ switch (representation.kind()) {
+ case Representation::kSmi:
+ field_rep = StoreHandler::kSmi;
+ break;
+ case Representation::kDouble:
+ field_rep = StoreHandler::kDouble;
+ break;
+ case Representation::kHeapObject:
+ field_rep = StoreHandler::kHeapObject;
+ break;
+ case Representation::kTagged:
+ field_rep = StoreHandler::kTagged;
+ break;
+ default:
+ UNREACHABLE();
+ return Handle<Object>::null();
+ }
+ int value_index = DescriptorArray::ToValueIndex(descriptor);
+
+ int config = StoreHandler::KindBits::encode(StoreHandler::kForFields) |
+ StoreHandler::IsInobjectBits::encode(field_index.is_inobject()) |
+ StoreHandler::FieldRepresentationBits::encode(field_rep) |
+ StoreHandler::DescriptorValueIndexBits::encode(value_index) |
+ StoreHandler::FieldOffsetBits::encode(field_index.offset());
+ return handle(Smi::FromInt(config), isolate);
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/ic/handler-configuration.h ('k') | src/ic/ic.cc » ('j') | src/ic/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698