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

Unified Diff: runtime/vm/intermediate_language_mips.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_mips.cc
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index bec3d41737a752be6a74089ed54c8cb9c40d986c..04825e78247aeff519101811099339414171f365 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -2636,8 +2636,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());
__ bltz(right, deopt);
@@ -2977,7 +2976,7 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ b(&done);
__ Bind(&subtract);
__ subu(result, result, TMP);
- } else if (right_range->IsWithin(0, RangeBoundary::kPlusInfinity)) {
+ } else if (right_range->IsPositive()) {
// Right is positive.
__ addu(result, result, TMP);
} else {
@@ -2997,7 +2996,7 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// sra operation masks the count to 5 bits.
const intptr_t kCountLimit = 0x1F;
if ((right_range == NULL) ||
- !right_range->IsWithin(RangeBoundary::kMinusInfinity, kCountLimit)) {
+ !right_range->OnlyLessThanOrEqualTo(kCountLimit)) {
Label ok;
__ BranchSignedLessEqual(temp, kCountLimit, &ok);
__ LoadImmediate(temp, kCountLimit);
@@ -4196,7 +4195,7 @@ void MergedMathInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ b(&done);
__ Bind(&subtract);
__ subu(result_mod, result_mod, TMP);
- } else if (right_range->IsWithin(0, RangeBoundary::kPlusInfinity)) {
+ } else if (right_range->IsPositive()) {
// Right is positive.
__ addu(result_mod, result_mod, TMP);
} else {

Powered by Google App Engine
This is Rietveld 408576698