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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 11275110: Do not recompute unary_checks repeatedly. Add special (and quicker) way to check for method overrid… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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_optimizer.h ('k') | no next file » | 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 14428)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -876,19 +876,8 @@
if (function.IsDynamicFunction() &&
callee_receiver->IsParameter() &&
(callee_receiver->AsParameter()->index() == 0)) {
- const intptr_t static_receiver_cid = Class::Handle(function.Owner()).id();
- ZoneGrowableArray<intptr_t>* subclass_cids =
- CHA::GetSubclassIdsOf(static_receiver_cid);
- if (subclass_cids->is_empty()) {
- // No subclasses, no check needed.
- return false;
- }
- ZoneGrowableArray<Function*>* overriding_functions =
- CHA::GetNamedInstanceFunctionsOf(*subclass_cids, call->function_name());
- if (overriding_functions->is_empty()) {
- // No overriding functions.
- return false;
- }
+ return CHA::HasOverride(Class::Handle(function.Owner()),
+ call->function_name());
}
return true;
}
@@ -1155,7 +1144,8 @@
if ((op_kind == Token::kGET) && TryInlineInstanceGetter(instr)) {
return;
}
- if ((op_kind == Token::kSET) && TryInlineInstanceSetter(instr)) {
+ if ((op_kind == Token::kSET) &&
+ TryInlineInstanceSetter(instr, unary_checks)) {
return;
}
if (TryInlineInstanceMethod(instr)) {
@@ -1198,15 +1188,16 @@
}
-bool FlowGraphOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr) {
+bool FlowGraphOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr,
+ const ICData& unary_ic_data) {
+ ASSERT((unary_ic_data.NumberOfChecks() > 0) &&
+ (unary_ic_data.num_args_tested() == 1));
if (FLAG_enable_type_checks) {
// TODO(srdjan): Add assignable check node if --enable_type_checks.
return false;
}
ASSERT(instr->HasICData());
- const ICData& unary_ic_data =
- ICData::Handle(instr->ic_data()->AsUnaryClassChecks());
if (unary_ic_data.NumberOfChecks() == 0) {
// No type feedback collected.
return false;
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698