Index: src/crankshaft/hydrogen-instructions.cc |
diff --git a/src/crankshaft/hydrogen-instructions.cc b/src/crankshaft/hydrogen-instructions.cc |
index 85222f63a376884d7bda88db0427f00645309ebc..3417d4e094836693be622013ab1eb27ac4072cf0 100644 |
--- a/src/crankshaft/hydrogen-instructions.cc |
+++ b/src/crankshaft/hydrogen-instructions.cc |
@@ -862,7 +862,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: |
@@ -2988,46 +2987,40 @@ bool HLoadKeyed::RequiresHoleCheck() const { |
return !UsesMustHandleHole(); |
} |
+HValue* HCallWithDescriptor::Canonicalize() { |
+ 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)"; |