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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 321593004: Refactor RangeBoundary +/- infinity to be distinct RangeBoundary kinds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 0a82178c589768a3fd93313c423c701b3aca03e3..a83436483ec8f03f14166fda1a5284c053e94a18 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -2654,8 +2654,7 @@ static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
if (is_truncating) {
if (right_needs_check) {
const bool right_may_be_negative =
- (right_range == NULL) ||
- !right_range->IsWithin(0, RangeBoundary::kPlusInfinity);
+ (right_range == NULL) || right_range->IsNegative();
if (right_may_be_negative) {
ASSERT(shift_left->CanDeoptimize());
__ CompareImmediate(right, Immediate(0), PP);
@@ -3107,7 +3106,7 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ jmp(&all_done, Assembler::kNearJump);
__ Bind(&subtract);
__ subq(result, right);
- } else if (right_range->IsWithin(0, RangeBoundary::kPlusInfinity)) {
+ } else if (right_range->IsPositive()) {
// Right is positive.
__ addq(result, right);
} else {
@@ -3127,7 +3126,7 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// sarq operation masks the count to 6 bits.
const intptr_t kCountLimit = 0x3F;
if ((right_range == NULL) ||
- !right_range->IsWithin(RangeBoundary::kMinusInfinity, kCountLimit)) {
+ !right_range->OnlyLessThanOrEqualTo(kCountLimit)) {
__ CompareImmediate(right, Immediate(kCountLimit), PP);
Label count_ok;
__ j(LESS, &count_ok, Assembler::kNearJump);
@@ -5249,7 +5248,7 @@ void MergedMathInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ jmp(&all_done, Assembler::kNearJump);
__ Bind(&subtract);
__ subq(RDX, right);
- } else if (right_range->IsWithin(0, RangeBoundary::kPlusInfinity)) {
+ } else if (right_range->IsPositive()) {
// Right is positive.
__ addq(RDX, right);
} else {
« runtime/vm/intermediate_language.h ('K') | « runtime/vm/intermediate_language_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698