Revision: 19878
Author: [email protected]
Date: Thu Mar 13 08:17:44 2014 UTC
Log: Remove uses of CanBeNegative() in HMod.
BUG=v8:3204
LOG=y
[email protected]
Review URL: https://codereview.chromium.org/195793016
http://code.google.com/p/v8/source/detail?r=19878
Modified:
/branches/bleeding_edge/src/a64/lithium-codegen-a64.cc
/branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
/branches/bleeding_edge/src/hydrogen-instructions.cc
/branches/bleeding_edge/src/hydrogen-instructions.h
/branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
/branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
=======================================
--- /branches/bleeding_edge/src/a64/lithium-codegen-a64.cc Thu Mar 13
07:58:58 2014 UTC
+++ /branches/bleeding_edge/src/a64/lithium-codegen-a64.cc Thu Mar 13
08:17:44 2014 UTC
@@ -4134,7 +4134,7 @@
HMod* hmod = instr->hydrogen();
int32_t mask = divisor < 0 ? -(divisor + 1) : (divisor - 1);
Label dividend_is_not_negative, done;
- if (hmod->left()->CanBeNegative()) {
+ if (hmod->CheckFlag(HValue::kLeftCanBeNegative)) {
__ Cmp(dividend, 0);
__ B(pl, ÷nd_is_not_negative);
// Note that this is correct even for kMinInt operands.
=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Thu Mar 13
07:58:58 2014 UTC
+++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Thu Mar 13
08:17:44 2014 UTC
@@ -1131,7 +1131,7 @@
HMod* hmod = instr->hydrogen();
int32_t mask = divisor < 0 ? -(divisor + 1) : (divisor - 1);
Label dividend_is_not_negative, done;
- if (hmod->left()->CanBeNegative()) {
+ if (hmod->CheckFlag(HValue::kLeftCanBeNegative)) {
__ cmp(dividend, Operand::Zero());
__ b(pl, ÷nd_is_not_negative);
// Note that this is correct even for kMinInt operands.
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Thu Mar 13
07:58:58 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.cc Thu Mar 13
08:17:44 2014 UTC
@@ -1865,6 +1865,10 @@
result->set_can_be_minus_zero(!CheckFlag(kAllUsesTruncatingToInt32) &&
left_can_be_negative);
+ if (!a->CanBeNegative()) {
+ ClearFlag(HValue::kLeftCanBeNegative);
+ }
+
if (!a->Includes(kMinInt) || !b->Includes(-1)) {
ClearFlag(HValue::kCanOverflow);
}
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Thu Mar 13 07:58:58
2014 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Thu Mar 13 08:17:44
2014 UTC
@@ -623,6 +623,7 @@
kBailoutOnMinusZero,
kCanBeDivByZero,
kLeftCanBeMinInt,
+ kLeftCanBeNegative,
kAllowUndefinedAsNaN,
kIsArguments,
kTruncatingToInt32,
@@ -855,7 +856,6 @@
Range* range() const { return range_; }
// TODO(svenpanne) We should really use the null object pattern here.
bool HasRange() const { return range_ != NULL; }
- bool CanBeNegative() const { return !HasRange() ||
range()->CanBeNegative(); }
void AddNewRange(Range* r, Zone* zone);
void RemoveLastAddedRange();
void ComputeInitialRange(Zone* zone);
@@ -4860,6 +4860,7 @@
HValue* right) : HArithmeticBinaryOperation(context, left, right) {
SetFlag(kCanBeDivByZero);
SetFlag(kCanOverflow);
+ SetFlag(kLeftCanBeNegative);
}
};
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Thu Mar 13
07:58:58 2014 UTC
+++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Thu Mar 13
08:17:44 2014 UTC
@@ -1385,7 +1385,7 @@
HMod* hmod = instr->hydrogen();
int32_t mask = divisor < 0 ? -(divisor + 1) : (divisor - 1);
Label dividend_is_not_negative, done;
- if (hmod->left()->CanBeNegative()) {
+ if (hmod->CheckFlag(HValue::kLeftCanBeNegative)) {
__ test(dividend, dividend);
__ j(not_sign, ÷nd_is_not_negative, Label::kNear);
// Note that this is correct even for kMinInt operands.
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Thu Mar 13
07:58:58 2014 UTC
+++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Thu Mar 13
08:17:44 2014 UTC
@@ -1004,7 +1004,7 @@
HMod* hmod = instr->hydrogen();
int32_t mask = divisor < 0 ? -(divisor + 1) : (divisor - 1);
Label dividend_is_not_negative, done;
- if (hmod->left()->CanBeNegative()) {
+ if (hmod->CheckFlag(HValue::kLeftCanBeNegative)) {
__ testl(dividend, dividend);
__ j(not_sign, ÷nd_is_not_negative, Label::kNear);
// Note that this is correct even for kMinInt operands.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.