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

Unified Diff: runtime/vm/jit_optimizer.cc

Issue 2716593002: Propagate this-specialization to regular (megamorphic) calls (Closed)
Patch Set: Add new Canonicalize call to make use of type data Created 3 years, 10 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/jit_optimizer.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/jit_optimizer.cc
diff --git a/runtime/vm/jit_optimizer.cc b/runtime/vm/jit_optimizer.cc
index 719f359c116b6fc679b2f6a9c0a1275ad2fa4b60..8bc07769b532db7e1b553235c51fc1ef7d04a4a1 100644
--- a/runtime/vm/jit_optimizer.cc
+++ b/runtime/vm/jit_optimizer.cc
@@ -192,33 +192,6 @@ bool JitOptimizer::TryCreateICData(InstanceCallInstr* call) {
}
-const ICData& JitOptimizer::TrySpecializeICData(const ICData& ic_data,
- intptr_t cid) {
- ASSERT(ic_data.NumArgsTested() == 1);
-
- if ((ic_data.NumberOfUsedChecks() == 1) && ic_data.HasReceiverClassId(cid)) {
- return ic_data; // Nothing to do
- }
-
- const Function& function =
- Function::Handle(Z, 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(
- Z, ICData::New(Function::Handle(Z, ic_data.Owner()),
- String::Handle(Z, ic_data.target_name()),
- Object::empty_array(), // Dummy argument descriptor.
- ic_data.deopt_id(), ic_data.NumArgsTested(), false));
- new_ic_data.SetDeoptReasons(ic_data.DeoptReasons());
- new_ic_data.AddReceiverCheck(cid, function);
- return new_ic_data;
- }
-
- return ic_data;
-}
-
-
void JitOptimizer::SpecializePolymorphicInstanceCall(
PolymorphicInstanceCallInstr* call) {
if (!FLAG_polymorphic_with_deopt) {
@@ -235,7 +208,8 @@ void JitOptimizer::SpecializePolymorphicInstanceCall(
return; // No information about receiver was infered.
}
- const ICData& ic_data = TrySpecializeICData(call->ic_data(), receiver_cid);
+ const ICData& ic_data = FlowGraphCompiler::TrySpecializeICDataByReceiverCid(
+ call->ic_data(), receiver_cid);
if (ic_data.raw() == call->ic_data().raw()) {
// No specialization.
return;
« no previous file with comments | « runtime/vm/jit_optimizer.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698