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

Unified Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2955073005: VM-codegen: Add IL instruction to check if a Smi is in a constant range
Patch Set: Remove unrelated change and other Slava feedback Created 3 years, 5 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/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_dbc.cc
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc
index 06c483dec102ccc091e35d5e0988ac27a1063eb0..19f4e6c02186b3c011d591d14a5805a958dfedf2 100644
--- a/runtime/vm/intermediate_language_dbc.cc
+++ b/runtime/vm/intermediate_language_dbc.cc
@@ -482,6 +482,26 @@ static void EmitBranchOnCondition(FlowGraphCompiler* compiler,
}
+Condition SmiRangeComparisonInstr::GetNextInstructionCondition(
+ FlowGraphCompiler* compiler,
+ BranchLabels labels) {
+ return is_negated() ? NEXT_IS_TRUE : NEXT_IS_FALSE;
+}
+
+
+Condition SmiRangeComparisonInstr::EmitComparisonCode(
+ FlowGraphCompiler* compiler,
+ BranchLabels labels) {
+ __ CheckClassIdRange(locs()->in(0).reg(),
+ compiler->ToEmbeddableCid(from_, this));
+ __ Nop(to_ - from_);
+ return is_negated() ? NEXT_IS_TRUE : NEXT_IS_FALSE;
+}
+
+
+DEFINE_MAKE_LOCATION_SUMMARY(SmiRangeComparison, 1)
+
+
Condition StrictCompareInstr::GetNextInstructionCondition(
FlowGraphCompiler* compiler,
BranchLabels labels) {
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698