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

Unified Diff: src/hydrogen-instructions.h

Issue 7634022: Insert representation changes before doing range analysis. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 4 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: src/hydrogen-instructions.h
===================================================================
--- src/hydrogen-instructions.h (revision 8984)
+++ src/hydrogen-instructions.h (working copy)
@@ -227,14 +227,20 @@
Range* next() const { return next_; }
Range* CopyClearLower() const { return new Range(kMinInt, upper_); }
Range* CopyClearUpper() const { return new Range(lower_, kMaxInt); }
- Range* Copy() const { return new Range(lower_, upper_); }
+ Range* Copy() const {
+ Range* result = new Range(lower_, upper_);
+ result->set_can_be_minus_zero(CanBeMinusZero());
+ return result;
+ }
int32_t Mask() const;
void set_can_be_minus_zero(bool b) { can_be_minus_zero_ = b; }
bool CanBeMinusZero() const { return CanBeZero() && can_be_minus_zero_; }
bool CanBeZero() const { return upper_ >= 0 && lower_ <= 0; }
bool CanBeNegative() const { return lower_ < 0; }
bool Includes(int value) const { return lower_ <= value && upper_ >= value; }
- bool IsMostGeneric() const { return lower_ == kMinInt && upper_ == kMaxInt; }
+ bool IsMostGeneric() const {
+ return lower_ == kMinInt && upper_ == kMaxInt && CanBeMinusZero();
+ }
bool IsInSmiRange() const {
return lower_ >= Smi::kMinValue && upper_ <= Smi::kMaxValue;
}
@@ -578,9 +584,9 @@
virtual bool IsConvertibleToInteger() const { return true; }
HType type() const { return type_; }
- void set_type(HType type) {
- ASSERT(HasNoUses());
- type_ = type;
+ void set_type(HType new_type) {
+ ASSERT(new_type.IsSubtypeOf(type_));
+ type_ = new_type;
}
// An operation needs to override this function iff:
@@ -1100,10 +1106,6 @@
set_representation(to);
SetFlag(kUseGVN);
if (is_truncating) SetFlag(kTruncatingToInt32);
- if (from.IsInteger32() && to.IsTagged() && value->range() != NULL &&
- value->range()->IsInSmiRange()) {
- set_type(HType::Smi());
- }
}
virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
@@ -1115,6 +1117,8 @@
return from_;
}
+ virtual Range* InferRange();
+
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(Change)

Powered by Google App Engine
This is Rietveld 408576698