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

Unified Diff: src/crankshaft/hydrogen-instructions.cc

Issue 2391043005: [crankshaft] Remove HLoadKeyedGeneric and use HCallWithDescriptor to call KeyedLoadIC. (Closed)
Patch Set: Rebasing 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/crankshaft/hydrogen-instructions.h ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)";
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698