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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 10572050: Removing more IC calls in optimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « runtime/vm/flow_graph_compiler_x64.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 8921)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -371,13 +371,18 @@
return;
}
const intptr_t kMaxChecks = 4;
- if (comp->ic_data()->num_args_tested() <= kMaxChecks) {
+ if (comp->ic_data()->NumberOfChecks() <= kMaxChecks) {
PolymorphicInstanceCallComp* call = new PolymorphicInstanceCallComp(comp);
ICData& unary_checks =
- ICData::Handle(ToUnaryClassChecks(*comp->ic_data()));
+ ICData::ZoneHandle(ToUnaryClassChecks(*comp->ic_data()));
call->set_ic_data(&unary_checks);
comp->ReplaceWith(call);
}
+ } else {
+ // Mark it for deopt.
+ PolymorphicInstanceCallComp* call = new PolymorphicInstanceCallComp(comp);
+ call->set_ic_data(&ICData::ZoneHandle());
+ comp->ReplaceWith(call);
}
}
@@ -399,7 +404,7 @@
return false;
}
if (!HasOneTarget(ic_data)) {
- // TODO(srdjan): Implement when not all targets are the sa,e.
+ // TODO(srdjan): Implement when not all targets are the same.
return false;
}
Function& target = Function::Handle();
@@ -426,10 +431,13 @@
void FlowGraphOptimizer::VisitInstanceSetter(InstanceSetterComp* comp) {
- // TODO(srdjan): Add assigneable check node if --enable_type_checks.
+ // TODO(srdjan): Add assignable check node if --enable_type_checks.
if (comp->HasICData() && !FLAG_enable_type_checks) {
- TryInlineInstanceSetter(comp);
+ if (TryInlineInstanceSetter(comp)) {
+ return;
+ }
}
+ // TODO(srdjan): Polymorphic dispatch to setters or deoptimize.
}
@@ -542,9 +550,8 @@
void FlowGraphOptimizer::VisitEqualityCompare(EqualityCompareComp* comp) {
- const intptr_t kMaxChecks = 4;
- if (comp->HasICData() && (comp->ic_data()->num_args_tested() <= kMaxChecks)) {
- // Replace binary checks with unary ones.
+ if (comp->HasICData()) {
+ // Replace binary checks with unary ones since EmitNative expects it.
ICData& unary_checks =
ICData::Handle(ToUnaryClassChecks(*comp->ic_data()));
comp->set_ic_data(&unary_checks);
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698