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

Unified Diff: src/ic/ic.cc

Issue 2489433003: [ic] Enable data handlers for all kinds of field stores. (Closed)
Patch Set: Rebasing Created 4 years, 1 month 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/flag-definitions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index c0ff6c9b2d164a9e9b05775ba3b0c40676ee012b..91430790265c4a00a89bed9366a50f373ed53fba 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -1136,37 +1136,6 @@ StubCache* IC::stub_cache() {
}
void IC::UpdateMegamorphicCache(Map* map, Name* name, Object* handler) {
- if (FLAG_store_ic_smi_handlers && handler->IsSmi() &&
- (kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC)) {
- // TODO(ishell, jkummerow): Implement data handlers support in
- // KeyedStoreIC_Megamorphic.
- Handle<Map> map_handle(map, isolate());
- Handle<Name> name_handle(name, isolate());
- int config = Smi::cast(handler)->value();
- int value_index = StoreHandler::DescriptorValueIndexBits::decode(config);
- int descriptor = (value_index - DescriptorArray::kDescriptorValue -
- DescriptorArray::kFirstIndex) /
- DescriptorArray::kDescriptorSize;
- if (map->instance_descriptors()->length()) {
- PropertyDetails details =
- map->instance_descriptors()->GetDetails(descriptor);
- DCHECK_EQ(DATA, details.type());
- DCHECK_EQ(name, map->instance_descriptors()->GetKey(descriptor));
- Representation representation = details.representation();
- FieldIndex index = FieldIndex::ForDescriptor(map, descriptor);
- TRACE_HANDLER_STATS(isolate(), StoreIC_StoreFieldStub);
- StoreFieldStub stub(isolate(), index, representation);
- handler = *stub.GetCode();
- } else {
- // It must be a prototype map that some prototype used to have. This map
- // check will never succeed so write a dummy smi to the cache.
- DCHECK(!map->is_dictionary_map());
- DCHECK(map->is_prototype_map());
- handler = Smi::FromInt(1);
- }
- stub_cache()->Set(*name_handle, *map_handle, handler);
- return;
- }
stub_cache()->Set(name, map, handler);
}
@@ -2007,20 +1976,20 @@ Handle<Object> StoreIC::GetMapIndependentHandler(LookupIterator* lookup) {
// -------------- Fields --------------
if (lookup->property_details().type() == DATA) {
- bool use_stub = true;
- if (lookup->representation().IsHeapObject()) {
- // Only use a generic stub if no types need to be tracked.
- Handle<FieldType> field_type = lookup->GetFieldType();
- use_stub = !field_type->IsClass();
- }
- if (use_stub) {
- if (FLAG_store_ic_smi_handlers) {
- TRACE_HANDLER_STATS(isolate(), StoreIC_StoreFieldDH);
- int descriptor = lookup->GetFieldDescriptorIndex();
- FieldIndex index = lookup->GetFieldIndex();
- return StoreHandler::StoreField(isolate(), descriptor, index,
- lookup->representation());
- } else {
+ if (FLAG_tf_store_ic_stub) {
+ TRACE_HANDLER_STATS(isolate(), StoreIC_StoreFieldDH);
+ int descriptor = lookup->GetFieldDescriptorIndex();
+ FieldIndex index = lookup->GetFieldIndex();
+ return StoreHandler::StoreField(isolate(), descriptor, index,
+ lookup->representation());
+ } else {
+ bool use_stub = true;
+ if (lookup->representation().IsHeapObject()) {
+ // Only use a generic stub if no types need to be tracked.
+ Handle<FieldType> field_type = lookup->GetFieldType();
+ use_stub = !field_type->IsClass();
+ }
+ if (use_stub) {
TRACE_HANDLER_STATS(isolate(), StoreIC_StoreFieldStub);
StoreFieldStub stub(isolate(), lookup->GetFieldIndex(),
lookup->representation());
@@ -2140,6 +2109,7 @@ Handle<Object> StoreIC::CompileHandler(LookupIterator* lookup,
// -------------- Fields --------------
if (lookup->property_details().type() == DATA) {
+ DCHECK(!FLAG_tf_store_ic_stub);
#ifdef DEBUG
bool use_stub = true;
if (lookup->representation().IsHeapObject()) {
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698