Chromium Code Reviews| Index: src/crankshaft/hydrogen-instructions.cc |
| diff --git a/src/crankshaft/hydrogen-instructions.cc b/src/crankshaft/hydrogen-instructions.cc |
| index 17d268cfe16d2e17a0dd59b9d1908a31a6ccc7e8..ce22a2ee660826717208fabd49637c2b8f89d6d8 100644 |
| --- a/src/crankshaft/hydrogen-instructions.cc |
| +++ b/src/crankshaft/hydrogen-instructions.cc |
| @@ -846,7 +846,6 @@ bool HInstruction::CanDeoptimize() { |
| case HValue::kLoadContextSlot: |
| case HValue::kLoadFunctionPrototype: |
| case HValue::kLoadKeyed: |
| - case HValue::kLoadKeyedGeneric: |
| case HValue::kMathFloorOfDiv: |
| case HValue::kMaybeGrowElements: |
| case HValue::kMod: |
| @@ -2972,46 +2971,40 @@ bool HLoadKeyed::RequiresHoleCheck() const { |
| return !UsesMustHandleHole(); |
| } |
| +HValue* HCallWithDescriptor::Canonicalize() { |
|
Igor Sheludko
2016/10/12 11:07:38
Non-trivial change.
|
| + if (kind() != Code::KEYED_LOAD_IC) return this; |
| -std::ostream& HLoadKeyedGeneric::PrintDataTo( |
| - std::ostream& os) const { // NOLINT |
| - return os << NameOf(object()) << "[" << NameOf(key()) << "]"; |
| -} |
| - |
| - |
| -HValue* HLoadKeyedGeneric::Canonicalize() { |
| // Recognize generic keyed loads that use property name generated |
| // by for-in statement as a key and rewrite them into fast property load |
| // by index. |
| - if (key()->IsLoadKeyed()) { |
| - HLoadKeyed* key_load = HLoadKeyed::cast(key()); |
| + typedef LoadWithVectorDescriptor Descriptor; |
| + HValue* key = parameter(Descriptor::kName); |
| + if (key->IsLoadKeyed()) { |
| + HLoadKeyed* key_load = HLoadKeyed::cast(key); |
| if (key_load->elements()->IsForInCacheArray()) { |
| HForInCacheArray* names_cache = |
| HForInCacheArray::cast(key_load->elements()); |
| - if (names_cache->enumerable() == object()) { |
| + HValue* object = parameter(Descriptor::kReceiver); |
| + if (names_cache->enumerable() == object) { |
| HForInCacheArray* index_cache = |
| names_cache->index_cache(); |
| HCheckMapValue* map_check = HCheckMapValue::New( |
| block()->graph()->isolate(), block()->graph()->zone(), |
| - block()->graph()->GetInvalidContext(), object(), |
| - names_cache->map()); |
| + block()->graph()->GetInvalidContext(), object, names_cache->map()); |
| HInstruction* index = HLoadKeyed::New( |
| block()->graph()->isolate(), block()->graph()->zone(), |
| block()->graph()->GetInvalidContext(), index_cache, key_load->key(), |
| key_load->key(), nullptr, key_load->elements_kind()); |
| map_check->InsertBefore(this); |
| index->InsertBefore(this); |
| - return Prepend(new(block()->zone()) HLoadFieldByIndex( |
| - object(), index)); |
| + return Prepend(new (block()->zone()) HLoadFieldByIndex(object, index)); |
| } |
| } |
| } |
| - |
| return this; |
| } |
| - |
| std::ostream& HStoreNamedField::PrintDataTo(std::ostream& os) const { // NOLINT |
| os << NameOf(object()) << access_ << " = " << NameOf(value()); |
| if (NeedsWriteBarrier()) os << " (write-barrier)"; |