Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index b43efc80baa9cb111b764a375e656ab9f522538e..bb3128d7a729b5d797b65e49156d267676a2cadd 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -352,6 +352,7 @@ class HType { |
| public: |
| HType() : type_(kUninitialized) { } |
| + static HType None() { return HType(kNone); } |
| static HType Tagged() { return HType(kTagged); } |
| static HType TaggedPrimitive() { return HType(kTaggedPrimitive); } |
| static HType TaggedNumber() { return HType(kTaggedNumber); } |
| @@ -447,6 +448,7 @@ class HType { |
| private: |
| enum Type { |
| + kNone = 0x0, // 0000 0000 0000 0000 |
| kTagged = 0x1, // 0000 0000 0000 0001 |
| kTaggedPrimitive = 0x5, // 0000 0000 0000 0101 |
| kTaggedNumber = 0xd, // 0000 0000 0000 1101 |
| @@ -3464,6 +3466,8 @@ class HConstant: public HTemplateInstruction<0> { |
| bool is_not_in_new_space, |
| bool is_cell, |
| bool boolean_value); |
| + HConstant(ExternalReference reference, |
| + Representation r = Representation::External()); |
| Handle<Object> handle() { |
| if (handle_.is_null()) { |
| @@ -3528,6 +3532,7 @@ class HConstant: public HTemplateInstruction<0> { |
| if (HasSmiValue()) return Representation::Smi(); |
| if (HasInteger32Value()) return Representation::Integer32(); |
| if (HasNumberValue()) return Representation::Double(); |
| + if (HasExternalValue()) return Representation::External(); |
| return Representation::Tagged(); |
| } |
| @@ -3579,6 +3584,8 @@ class HConstant: public HTemplateInstruction<0> { |
| bool HasInternalizedStringValue() const { |
| return HasStringValue() && is_internalized_string_; |
| } |
| + bool HasExternalValue() const { return has_external_value_; } |
| + ExternalReference ExternalValue() const { return external_value_; } |
| bool BooleanValue() const { return boolean_value_; } |
| @@ -3587,6 +3594,8 @@ class HConstant: public HTemplateInstruction<0> { |
| return static_cast<intptr_t>(int32_value_); |
| } else if (has_double_value_) { |
| return static_cast<intptr_t>(BitCast<int64_t>(double_value_)); |
| + } else if (has_external_value_) { |
| + return reinterpret_cast<intptr_t>(external_value_.address()); |
| } else { |
| ASSERT(!handle_.is_null()); |
| return unique_id_.Hashcode(); |
| @@ -3594,14 +3603,14 @@ class HConstant: public HTemplateInstruction<0> { |
| } |
| virtual void FinalizeUniqueValueId() { |
| - if (!has_double_value_) { |
| + if (!has_double_value_ && !has_external_value_) { |
| ASSERT(!handle_.is_null()); |
| unique_id_ = UniqueValueId(handle_); |
| } |
| } |
| bool UniqueValueIdsMatch(UniqueValueId other) { |
| - return !has_double_value_ && unique_id_ == other; |
| + return !has_double_value_ && !has_external_value_ && unique_id_ == other; |
| } |
| #ifdef DEBUG |
| @@ -3622,6 +3631,9 @@ class HConstant: public HTemplateInstruction<0> { |
| return other_constant->has_double_value_ && |
| BitCast<int64_t>(double_value_) == |
| BitCast<int64_t>(other_constant->double_value_); |
| + } else if (has_external_value_) { |
| + return other_constant->has_external_value_ && |
| + external_value_ == other_constant->external_value_; |
| } else { |
| ASSERT(!handle_.is_null()); |
| return !other_constant->handle_.is_null() && |
| @@ -3649,12 +3661,14 @@ class HConstant: public HTemplateInstruction<0> { |
| bool has_smi_value_ : 1; |
| bool has_int32_value_ : 1; |
| bool has_double_value_ : 1; |
| + bool has_external_value_ : 1; |
| bool is_internalized_string_ : 1; // TODO(yangguo): make this part of HType. |
| bool is_not_in_new_space_ : 1; |
| bool is_cell_ : 1; |
| bool boolean_value_ : 1; |
| int32_t int32_value_; |
| double double_value_; |
| + ExternalReference external_value_; |
| HType type_from_value_; |
| }; |
| @@ -5553,6 +5567,10 @@ class HObjectAccess { |
| return HObjectAccess(kInobject, AllocationMemento::kAllocationSiteOffset); |
| } |
| + static HObjectAccess ForInteger32() { |
|
titzer
2013/07/25 11:56:47
Would prefer this to be ForExternalReference() or
danno
2013/07/25 12:05:08
You need to change the kDependsOn/ChangesSpecializ
|
| + return HObjectAccess(kInobject, 0, Representation::Integer32()); |
| + } |
| + |
| // Create an access to an offset in a fixed array header. |
| static HObjectAccess ForFixedArrayHeader(int offset); |