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

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 | 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 31601)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -178,7 +178,7 @@
}
-static const ICData& SpecializeICData(const ICData& ic_data, intptr_t cid) {
+static const ICData& TrySpecializeICData(const ICData& ic_data, intptr_t cid) {
ASSERT(ic_data.num_args_tested() == 1);
if ((ic_data.NumberOfChecks() == 1) &&
@@ -186,21 +186,23 @@
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));
+ // TODO(fschneider): Try looking up the function on the class if it is
+ // not found in the ICData.
if (!function.IsNull()) {
+ 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());
new_ic_data.AddReceiverCheck(cid, function);
+ return new_ic_data;
}
- return new_ic_data;
+ return ic_data;
}
@@ -216,7 +218,11 @@
return; // No information about receiver was infered.
}
- const ICData& ic_data = SpecializeICData(call->ic_data(), receiver_cid);
+ const ICData& ic_data = TrySpecializeICData(call->ic_data(), receiver_cid);
+ if (ic_data.raw() == call->ic_data().raw()) {
+ // No specialization.
+ return;
+ }
const bool with_checks = false;
PolymorphicInstanceCallInstr* specialized =
« 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