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

Unified Diff: runtime/vm/intermediate_language_x64.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_ia32.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_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 6cff06c7fa2b8ab5927f66dc255cc2e656731b75..e9721fdfe0806be91319e018cda7dc5a4ad84b24 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -6506,6 +6506,30 @@ void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ jmp(target_address_reg);
}
+
+LocationSummary* SmiRangeComparisonInstr::MakeLocationSummary(Zone* zone,
+ bool opt) const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 1;
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ locs->set_in(0, Location::RequiresRegister());
+ locs->set_temp(0, Location::RequiresRegister());
+ return locs;
+}
+
+
+Condition SmiRangeComparisonInstr::EmitComparisonCode(
+ FlowGraphCompiler* compiler,
+ BranchLabels labels) {
+ Register in = locs()->in(0).reg();
+ Register temp = locs()->temp(0).reg();
+ __ leaq(temp, Address(in, Smi::RawValue(-from_)));
+ __ cmpq(temp, Immediate(Smi::RawValue(to_ - from_)));
+ return is_negated() ? ABOVE : BELOW_EQUAL;
+}
+
+
LocationSummary* StrictCompareInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698