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

Unified Diff: src/hydrogen-instructions.cc

Issue 10411016: Fix for issue 2132. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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
« src/hydrogen.cc ('K') | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index c66a7a137d5cbe67b9c76166d84997f77c4ec8ef..f495eeef0f838faf8209efed205b19554ad2e1f3 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -522,8 +522,23 @@ void HValue::RemoveLastAddedRange() {
void HValue::ComputeInitialRange(Zone* zone) {
+ ASSERT(CheckFlag(kHasPreinitializedRange) || !HasRange());
+ Range* new_range = InferRange(zone);
+ if (CheckFlag(kHasPreinitializedRange)) {
+ range_->Intersect(new_range);
+ ClearFlag(kHasPreinitializedRange);
+ } else {
+ range_ = new_range;
+ }
+ ASSERT(HasRange());
+}
+
+
+void HValue::PreinitializeRange(Zone* zone) {
ASSERT(!HasRange());
- range_ = InferRange(zone);
+ range_ = new(zone) Range();
+ range_->set_can_be_minus_zero(true);
+ SetFlag(kHasPreinitializedRange);
ASSERT(HasRange());
}
@@ -861,11 +876,15 @@ HValue* HBitwise::Canonicalize() {
if (left()->IsConstant() &&
HConstant::cast(left())->HasInteger32Value() &&
HConstant::cast(left())->Integer32Value() == nop_constant) {
+ right()->PreinitializeRange(block()->zone());
+ right()->range()->set_can_be_minus_zero(false);
Vyacheslav Egorov (Chromium) 2012/05/18 17:39:05 I don't think this is correct. Consider code like:
return right();
}
if (right()->IsConstant() &&
HConstant::cast(right())->HasInteger32Value() &&
HConstant::cast(right())->Integer32Value() == nop_constant) {
+ left()->PreinitializeRange(block()->zone());
+ left()->range()->set_can_be_minus_zero(false);
return left();
}
return this;
« src/hydrogen.cc ('K') | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698