summaryrefslogtreecommitdiff
path: root/deps/v8/src/hydrogen-instructions.h
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-08-26 13:07:04 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-08-26 13:07:04 -0700
commit028908ab7cc576d3013960a4580fcd9bf21cc26e (patch)
tree0bde01f82e9b1622793917ee41db581b7b960833 /deps/v8/src/hydrogen-instructions.h
parent8af0abde3fab7d5e8b64f42c26d3dec06b9bdc68 (diff)
downloadnode-028908ab7cc576d3013960a4580fcd9bf21cc26e.tar.gz
Upgrade V8 to 3.5.8
Diffstat (limited to 'deps/v8/src/hydrogen-instructions.h')
-rw-r--r--deps/v8/src/hydrogen-instructions.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/deps/v8/src/hydrogen-instructions.h b/deps/v8/src/hydrogen-instructions.h
index e7a9104e8..76007d764 100644
--- a/deps/v8/src/hydrogen-instructions.h
+++ b/deps/v8/src/hydrogen-instructions.h
@@ -227,14 +227,20 @@ class Range: public ZoneObject {
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 @@ class HValue: public ZoneObject {
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 @@ class HChange: public HUnaryOperation {
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 @@ class HChange: public HUnaryOperation {
return from_;
}
+ virtual Range* InferRange();
+
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(Change)
@@ -3405,12 +3409,12 @@ class HLoadNamedFieldPolymorphic: public HTemplateInstruction<2> {
public:
HLoadNamedFieldPolymorphic(HValue* context,
HValue* object,
- ZoneMapList* types,
+ SmallMapList* types,
Handle<String> name);
HValue* context() { return OperandAt(0); }
HValue* object() { return OperandAt(1); }
- ZoneMapList* types() { return &types_; }
+ SmallMapList* types() { return &types_; }
Handle<String> name() { return name_; }
bool need_generic() { return need_generic_; }
@@ -3428,7 +3432,7 @@ class HLoadNamedFieldPolymorphic: public HTemplateInstruction<2> {
virtual bool DataEquals(HValue* value);
private:
- ZoneMapList types_;
+ SmallMapList types_;
Handle<String> name_;
bool need_generic_;
};