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

Unified Diff: src/hydrogen.cc

Issue 1093413002: VectorICs: support converting keyed loads into named loads in crankshaft. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 7b91d9846188f52732ef538ef0c57175c421d7f8..ef9901593d5085ac0dc82f8928836126b1cb9eb0 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -6968,15 +6968,29 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric(
Deoptimizer::SOFT);
}
if (access_type == LOAD) {
- HLoadNamedGeneric* result =
- New<HLoadNamedGeneric>(object, name, PREMONOMORPHIC);
if (FLAG_vector_ics) {
Handle<TypeFeedbackVector> vector =
handle(current_feedback_vector(), isolate());
FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot();
+
+ 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, PREMONOMORPHIC);
+ result->SetVectorAndSlot(vector, slot);
+ return result;
+ }
+
+ HLoadNamedGeneric* result =
+ New<HLoadNamedGeneric>(object, name, PREMONOMORPHIC);
result->SetVectorAndSlot(vector, slot);
+ return result;
}
- return result;
+ return New<HLoadNamedGeneric>(object, name, PREMONOMORPHIC);
} else {
return New<HStoreNamedGeneric>(object, name, value,
function_language_mode(), PREMONOMORPHIC);
@@ -7279,9 +7293,7 @@ HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess(
HValue* obj, HValue* key, HValue* val, Expression* expr, BailoutId ast_id,
BailoutId return_id, PropertyAccessType access_type,
bool* has_side_effects) {
- // TODO(mvstanton): This optimization causes trouble for vector-based
- // KeyedLoadICs, turn it off for now.
- if (!FLAG_vector_ics && key->ActualValue()->IsConstant()) {
+ if (key->ActualValue()->IsConstant()) {
Handle<Object> constant =
HConstant::cast(key->ActualValue())->handle(isolate());
uint32_t array_index;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698