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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 128113003: Fix bug in specialization of IC-data. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')
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 31601)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -186,21 +186,20 @@
return ic_data; // Nothing to do
}
- const ICData& new_ic_data = ICData::ZoneHandle(ICData::New(
- Function::Handle(ic_data.function()),
- String::Handle(ic_data.target_name()),
- Object::empty_array(), // Dummy argument descriptor.
- ic_data.deopt_id(),
- ic_data.num_args_tested()));
- new_ic_data.set_deopt_reason(ic_data.deopt_reason());
-
const Function& function =
Function::Handle(ic_data.GetTargetForReceiverClassId(cid));
if (!function.IsNull()) {
+ const ICData& new_ic_data = ICData::ZoneHandle(ICData::New(
Vyacheslav Egorov (Google) 2014/01/08 13:00:00 You can actually look up target function on the cl
Florian Schneider 2014/01/08 14:12:43 Added a TODO.
+ Function::Handle(ic_data.function()),
+ String::Handle(ic_data.target_name()),
+ Object::empty_array(), // Dummy argument descriptor.
+ ic_data.deopt_id(),
+ ic_data.num_args_tested()));
+ new_ic_data.set_deopt_reason(ic_data.deopt_reason());
new_ic_data.AddReceiverCheck(cid, function);
+ return new_ic_data;
}
-
- return new_ic_data;
+ return ic_data;
Vyacheslav Egorov (Google) 2014/01/08 13:00:00 add empty line before return for readability.
Florian Schneider 2014/01/08 14:12:43 Done.
}
@@ -217,13 +216,15 @@
}
const ICData& ic_data = SpecializeICData(call->ic_data(), receiver_cid);
Vyacheslav Egorov (Google) 2014/01/08 13:00:00 I would rename SpecializeICData to TrySpecializeIC
Florian Schneider 2014/01/08 14:12:43 Done.
-
- const bool with_checks = false;
- PolymorphicInstanceCallInstr* specialized =
- new PolymorphicInstanceCallInstr(call->instance_call(),
- ic_data,
- with_checks);
- call->ReplaceWith(specialized, current_iterator());
+ if (ic_data.raw() != call->ic_data().raw()) {
Vyacheslav Egorov (Google) 2014/01/08 13:00:00 You can change this to match the early exit patter
Florian Schneider 2014/01/08 14:12:43 Done.
+ // Only replace the call if ICData were specialized.
+ const bool with_checks = false;
+ PolymorphicInstanceCallInstr* specialized =
+ new PolymorphicInstanceCallInstr(call->instance_call(),
+ ic_data,
+ with_checks);
+ call->ReplaceWith(specialized, current_iterator());
+ }
}
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698