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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 2398683004: [crankshaft] Remove HLoadNamedGeneric and use HCallWithDescriptor to call LoadIC. (Closed)
Patch Set: 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/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 76ff46df51310f485d5d01d03104c61cafa00fae..758a4dd9277f1cf38e305795f7f7ee32e6f232ee 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -7097,36 +7097,35 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric(
DeoptimizeReason::kInsufficientTypeFeedbackForGenericNamedAccess,
Deoptimizer::SOFT);
}
- if (access_type == LOAD) {
- Handle<TypeFeedbackVector> vector =
- handle(current_feedback_vector(), isolate());
+ Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
+ HValue* key = Add<HConstant>(name);
+ HValue* vector_value = Add<HConstant>(vector);
+ HValue* slot_value = Add<HConstant>(vector->GetIndex(slot));
+
+ if (access_type == LOAD) {
+ HValue* values[] = {context(), object, key, slot_value, vector_value};
if (!expr->AsProperty()->key()->IsPropertyName()) {
// It's possible that a keyed load of a constant string was converted
// to a named load. Here, at the last minute, we need to make sure to
// use a generic Keyed Load if we are using the type vector, because
// it has to share information with full code.
- HConstant* key = Add<HConstant>(name);
HLoadKeyedGeneric* result =
New<HLoadKeyedGeneric>(object, key, vector, slot);
return result;
}
- HLoadNamedGeneric* result =
- New<HLoadNamedGeneric>(object, name, vector, slot);
+ Callable callable = CodeFactory::LoadICInOptimizedCode(isolate());
+ HValue* stub = Add<HConstant>(callable.code());
+ HCallWithDescriptor* result = New<HCallWithDescriptor>(
+ stub, 0, callable.descriptor(), ArrayVector(values));
return result;
- } else {
- Handle<TypeFeedbackVector> vector =
- handle(current_feedback_vector(), isolate());
- HValue* key = Add<HConstant>(name);
- HValue* vector_value = Add<HConstant>(vector);
- HValue* slot_value = Add<HConstant>(vector->GetIndex(slot));
+ } else {
HValue* values[] = {context(), object, key,
value, slot_value, vector_value};
- if (current_feedback_vector()->GetKind(slot) ==
- FeedbackVectorSlotKind::KEYED_STORE_IC) {
+ if (vector->GetKind(slot) == FeedbackVectorSlotKind::KEYED_STORE_IC) {
// It's possible that a keyed store of a constant string was converted
// to a named store. Here, at the last minute, we need to make sure to
// use a generic Keyed Store if we are using the type vector, because
« no previous file with comments | « src/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698