Commit e82fe7b0 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Don't inline polymorphic cases if not all cases can be handled inline.

BUG=
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/578233002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24029 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 68884792
......@@ -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,7 +6286,12 @@ void HOptimizedGraphBuilder::HandlePolymorphicNamedFieldAccess(
}
}
count = 0;
if (i < types->length()) {
count = -1;
types->Clear();
} else {
count = 0;
}
HControlInstruction* smi_check = NULL;
handled_string = false;
......@@ -7496,8 +7502,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 +7524,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment