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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 2962333002: VM-codegen: Restrict widening class ranges in method dispatch (Closed)
Patch Set: Created 3 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
« runtime/vm/flow_graph_compiler.h ('K') | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 9db5af0f6200ebc24587140cb70c0304e61607cc..68cf40125c2256810f757cb0aa8dc01ef8ffe21c 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -2978,9 +2978,13 @@ CallTargets* CallTargets::CreateAndExpand(Zone* zone, const ICData& ic_data) {
const Function& target = *targets.TargetAt(idx)->target;
if (MethodRecognizer::PolymorphicTarget(target)) continue;
for (int i = targets[idx].cid_start - 1; i > lower_limit_cid; i--) {
- if (FlowGraphCompiler::LookupMethodFor(i, name, args_desc, &fn) &&
+ bool class_is_abstract = false;
+ if (FlowGraphCompiler::LookupMethodFor(i, name, args_desc, &fn,
+ &class_is_abstract) &&
fn.raw() == target.raw()) {
- targets[idx].cid_start = i;
+ if (!class_is_abstract) {
+ targets[idx].cid_start = i;
+ }
} else {
break;
}
@@ -2994,9 +2998,13 @@ CallTargets* CallTargets::CreateAndExpand(Zone* zone, const ICData& ic_data) {
const Function& target = *targets.TargetAt(idx)->target;
if (MethodRecognizer::PolymorphicTarget(target)) continue;
for (int i = targets[idx].cid_end + 1; i < upper_limit_cid; i++) {
- if (FlowGraphCompiler::LookupMethodFor(i, name, args_desc, &fn) &&
+ bool class_is_abstract = false;
+ if (FlowGraphCompiler::LookupMethodFor(i, name, args_desc, &fn,
+ &class_is_abstract) &&
fn.raw() == target.raw()) {
- targets[idx].cid_end = i;
+ if (!class_is_abstract) {
+ targets[idx].cid_end = i;
+ }
} else {
break;
}
« runtime/vm/flow_graph_compiler.h ('K') | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698