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

Unified Diff: src/hydrogen.cc

Issue 578233002: Don't inline polymorphic cases if not all cases can be handled inline. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 3c0705c7346f532b304357f83d90496af5edc4de..e87266bf0e44c5fba86d007381cb4ddc8a2e07eb 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -6270,7 +6270,8 @@ void HOptimizedGraphBuilder::HandlePolymorphicNamedFieldAccess(
bool handle_smi = false;
STATIC_ASSERT(kMaxLoadPolymorphism == kMaxStorePolymorphism);
- for (int i = 0; i < types->length() && count < kMaxLoadPolymorphism; ++i) {
+ int i;
+ for (i = 0; i < types->length() && count < kMaxLoadPolymorphism; ++i) {
PropertyAccessInfo info(this, access_type, ToType(types->at(i)), name);
if (info.type()->Is(Type::String())) {
if (handled_string) continue;
@@ -6285,10 +6286,16 @@ void HOptimizedGraphBuilder::HandlePolymorphicNamedFieldAccess(
}
}
- count = 0;
+ if (i < types->length()) {
+ count = -1;
+ types->Clear();
+ } else {
+ count = 0;
+ }
HControlInstruction* smi_check = NULL;
handled_string = false;
+
Jakob Kummerow 2014/09/18 09:48:45 nit: unnecessary empty line
for (int i = 0; i < types->length() && count < kMaxLoadPolymorphism; ++i) {
PropertyAccessInfo info(this, access_type, ToType(types->at(i)), name);
if (info.type()->Is(Type::String())) {
@@ -7496,8 +7503,8 @@ void HOptimizedGraphBuilder::HandlePolymorphicCallNamed(
bool handled_string = false;
int ordered_functions = 0;
- for (int i = 0;
- i < types->length() && ordered_functions < kMaxCallPolymorphism;
+ int i;
+ for (i = 0; i < types->length() && ordered_functions < kMaxCallPolymorphism;
++i) {
PropertyAccessInfo info(this, LOAD, ToType(types->at(i)), name);
if (info.CanAccessMonomorphic() && info.IsConstant() &&
@@ -7518,6 +7525,11 @@ void HOptimizedGraphBuilder::HandlePolymorphicCallNamed(
std::sort(order, order + ordered_functions);
+ if (i < types->length()) {
+ types->Clear();
+ ordered_functions = -1;
+ }
+
HBasicBlock* number_block = NULL;
HBasicBlock* join = NULL;
handled_string = false;
« 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