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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 2955073005: VM-codegen: Add IL instruction to check if a Smi is in a constant range
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
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 9db5af0f6200ebc24587140cb70c0304e61607cc..43b3a67526efa14cac66fae2882a28e24da5cba6 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;
}
@@ -3885,6 +3893,14 @@ ComparisonInstr* DoubleTestOpInstr::CopyWithNewOperands(Value* new_left,
}
+ComparisonInstr* SmiRangeComparisonInstr::CopyWithNewOperands(
+ Value* new_left,
+ Value* new_right) {
+ UNREACHABLE();
+ return NULL;
+}
+
+
ComparisonInstr* EqualityCompareInstr::CopyWithNewOperands(Value* new_left,
Value* new_right) {
return new EqualityCompareInstr(token_pos(), kind(), new_left, new_right,

Powered by Google App Engine
This is Rietveld 408576698