Index: src/ic/ic.cc |
diff --git a/src/ic/ic.cc b/src/ic/ic.cc |
index fa44c2aeaa748f93ef95debaa1a082ae7603ba5c..3015e01686d2ae9c1b4e03b4bf5c6509bcdf55bc 100644 |
--- a/src/ic/ic.cc |
+++ b/src/ic/ic.cc |
@@ -567,11 +567,11 @@ |
nexus->ConfigureMonomorphic(name, map, handler); |
} else if (kind() == Code::STORE_IC) { |
StoreICNexus* nexus = casted_nexus<StoreICNexus>(); |
- nexus->ConfigureMonomorphic(map, handler); |
+ nexus->ConfigureMonomorphic(map, Handle<Code>::cast(handler)); |
} else { |
DCHECK(kind() == Code::KEYED_STORE_IC); |
KeyedStoreICNexus* nexus = casted_nexus<KeyedStoreICNexus>(); |
- nexus->ConfigureMonomorphic(name, map, handler); |
+ nexus->ConfigureMonomorphic(name, map, Handle<Code>::cast(handler)); |
} |
vector_set_ = true; |
@@ -790,10 +790,8 @@ |
void IC::PatchCache(Handle<Name> name, Handle<Object> handler) { |
DCHECK(IsHandler(*handler)); |
// Currently only LoadIC and KeyedLoadIC support non-code handlers. |
- DCHECK_IMPLIES(!handler->IsCode(), kind() == Code::LOAD_IC || |
- kind() == Code::KEYED_LOAD_IC || |
- kind() == Code::STORE_IC || |
- kind() == Code::KEYED_STORE_IC); |
+ DCHECK_IMPLIES(!handler->IsCode(), |
+ kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC); |
switch (state()) { |
case UNINITIALIZED: |
case PREMONOMORPHIC: |
@@ -1012,30 +1010,6 @@ |
} |
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; |
- |
- 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); |
- Code* handler = *stub.GetCode(); |
- stub_cache()->Set(*name_handle, *map_handle, handler); |
- return; |
- } |
stub_cache()->Set(name, map, handler); |
} |
@@ -1667,10 +1641,10 @@ |
if (!use_ic) { |
TRACE_GENERIC_IC(isolate(), "StoreIC", "LookupForWrite said 'false'"); |
} |
- Handle<Object> handler = use_ic ? ComputeHandler(lookup, value) |
- : Handle<Object>::cast(slow_stub()); |
- |
- PatchCache(lookup->name(), handler); |
+ Handle<Code> code = |
+ use_ic ? Handle<Code>::cast(ComputeHandler(lookup, value)) : slow_stub(); |
+ |
+ PatchCache(lookup->name(), code); |
TRACE_IC("StoreIC", lookup->name()); |
} |
@@ -1789,25 +1763,17 @@ |
// -------------- Fields -------------- |
if (lookup->property_details().type() == DATA) { |
- 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 { |
- 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()); |
- return stub.GetCode(); |
- } |
+ 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()); |
+ return stub.GetCode(); |
} |
break; // Custom-compiled handler. |
} |
@@ -1925,7 +1891,6 @@ |
#ifdef DEBUG |
bool use_stub = true; |
if (lookup->representation().IsHeapObject()) { |
- DCHECK(!FLAG_store_ic_smi_handlers); |
// Only use a generic stub if no types need to be tracked. |
Handle<FieldType> field_type = lookup->GetFieldType(); |
use_stub = !field_type->IsClass(); |