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

Unified Diff: src/hydrogen.cc

Issue 667923004: Go generic on polymorphic KeyedLoads with string+other maps (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « no previous file | test/mjsunit/regress/regress-crbug-425519.js » ('j') | 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 3f9d32de1c5ee3153026bb218fdf48f1e40e5a8a..a59be065f2f9ae286a507ee79536ee9d323781ee 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7033,6 +7033,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
MapHandleList possible_transitioned_maps(maps->length());
for (int i = 0; i < maps->length(); ++i) {
Handle<Map> map = maps->at(i);
+ DCHECK(!map->IsStringMap());
ElementsKind elements_kind = map->elements_kind();
if (IsFastElementsKind(elements_kind) &&
elements_kind != GetInitialFastElementsKind()) {
@@ -7196,6 +7197,19 @@ HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess(
break;
}
}
+ } else if (access_type == LOAD && !monomorphic &&
+ (types != NULL && !types->is_empty())) {
+ // Polymorphic loads have to go generic if any of the maps are strings.
+ // If some, but not all of the maps are strings, we should go generic
+ // because polymorphic access wants to key on ElementsKind and isn't
+ // compatible with strings.
+ for (int i = 0; i < types->length(); i++) {
+ Handle<Map> current_map = types->at(i);
+ if (current_map->IsStringMap()) {
+ force_generic = true;
+ break;
+ }
+ }
}
if (monomorphic) {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-425519.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698