Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index 0a92a9f4234b2a87e612c6fbd0cfcd4a787f3c97..35db6525784d4951ee52302562def313688b5f5a 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -3438,8 +3438,8 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> { |
| bool is_not_in_new_space, |
| HInstruction* instruction) { |
| return instruction->Prepend(new(zone) HConstant( |
| - unique, Representation::Tagged(), HType::Tagged(), false, |
| - is_not_in_new_space, false, false)); |
| + unique, Representation::Tagged(), HType::Tagged(), |
| + is_not_in_new_space, false, false, kUnknownInstanceType)); |
| } |
| Handle<Object> handle(Isolate* isolate) { |
| @@ -3474,7 +3474,7 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> { |
| bool ImmortalImmovable() const; |
| bool IsCell() const { |
| - return is_cell_; |
| + return instance_type_ == CELL_TYPE || instance_type_ == PROPERTY_CELL_TYPE; |
| } |
| virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| @@ -3522,14 +3522,14 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> { |
| bool HasStringValue() const { |
| if (has_double_value_ || has_int32_value_) return false; |
| ASSERT(!object_.handle().is_null()); |
| - return type_.IsString(); |
| + return instance_type_ < FIRST_NONSTRING_TYPE; |
| } |
| Handle<String> StringValue() const { |
| ASSERT(HasStringValue()); |
| return Handle<String>::cast(object_.handle()); |
| } |
| bool HasInternalizedStringValue() const { |
| - return HasStringValue() && is_internalized_string_; |
| + return HasStringValue() && StringShape(instance_type_).IsInternalized(); |
| } |
| bool HasExternalReferenceValue() const { |
| @@ -3541,6 +3541,8 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> { |
| bool HasBooleanValue() const { return type_.IsBoolean(); } |
| bool BooleanValue() const { return boolean_value_; } |
| + bool IsUndetectable() const { return is_undetectable_; } |
| + InstanceType GetInstanceType() const { return instance_type_; } |
| virtual intptr_t Hashcode() V8_OVERRIDE { |
| if (has_int32_value_) { |
| @@ -3613,10 +3615,10 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> { |
| HConstant(Unique<Object> unique, |
| Representation r, |
| HType type, |
| - bool is_internalized_string, |
| bool is_not_in_new_space, |
| - bool is_cell, |
| - bool boolean_value); |
| + bool boolean_value, |
| + bool is_undetectable, |
| + InstanceType instance_type); |
| explicit HConstant(ExternalReference reference); |
| @@ -3641,11 +3643,14 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> { |
| bool has_external_reference_value_ : 1; |
| bool is_internalized_string_ : 1; // TODO(yangguo): make this part of HType. |
|
Jakob Kummerow
2014/03/07 18:32:35
I think we don't need this any more.
|
| bool is_not_in_new_space_ : 1; |
| - bool is_cell_ : 1; |
| bool boolean_value_ : 1; |
| + bool is_undetectable_: 1; |
| int32_t int32_value_; |
| double double_value_; |
| ExternalReference external_reference_value_; |
| + |
| + static const InstanceType kUnknownInstanceType = FILLER_TYPE; |
| + InstanceType instance_type_; |
| }; |
| @@ -4314,6 +4319,8 @@ class HIsObjectAndBranch V8_FINAL : public HUnaryControlInstruction { |
| return Representation::Tagged(); |
| } |
| + virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; |
| + |
| DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch) |
| private: |
| @@ -4334,6 +4341,8 @@ class HIsStringAndBranch V8_FINAL : public HUnaryControlInstruction { |
| return Representation::Tagged(); |
| } |
| + virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; |
| + |
| DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch) |
| protected: |
| @@ -4359,6 +4368,8 @@ class HIsSmiAndBranch V8_FINAL : public HUnaryControlInstruction { |
| return Representation::Tagged(); |
| } |
| + virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; |
| + |
| protected: |
| virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } |
| virtual int RedefinedOperandIndex() { return 0; } |
| @@ -4381,6 +4392,8 @@ class HIsUndetectableAndBranch V8_FINAL : public HUnaryControlInstruction { |
| return Representation::Tagged(); |
| } |
| + virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; |
| + |
| DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch) |
| private: |
| @@ -4463,6 +4476,8 @@ class HHasInstanceTypeAndBranch V8_FINAL : public HUnaryControlInstruction { |
| return Representation::Tagged(); |
| } |
| + virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; |
| + |
| DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch) |
| private: |
| @@ -4544,8 +4559,7 @@ class HTypeofIsAndBranch V8_FINAL : public HUnaryControlInstruction { |
| public: |
| DECLARE_INSTRUCTION_FACTORY_P2(HTypeofIsAndBranch, HValue*, Handle<String>); |
| - Handle<String> type_literal() { return type_literal_; } |
| - bool compares_number_type() { return compares_number_type_; } |
| + Handle<String> type_literal() { return type_literal_.handle(); } |
| virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch) |
| @@ -4556,16 +4570,19 @@ class HTypeofIsAndBranch V8_FINAL : public HUnaryControlInstruction { |
| virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; |
| + virtual void FinalizeUniqueness() V8_OVERRIDE { |
| + type_literal_ = Unique<String>(type_literal_.handle()); |
| + } |
| + |
| private: |
| HTypeofIsAndBranch(HValue* value, Handle<String> type_literal) |
| - : HUnaryControlInstruction(value, NULL, NULL), |
| - type_literal_(type_literal) { |
| - Heap* heap = type_literal->GetHeap(); |
| - compares_number_type_ = type_literal->Equals(heap->number_string()); |
| - } |
| + : HUnaryControlInstruction(value, NULL, NULL), |
|
Jakob Kummerow
2014/03/07 18:32:35
nit: indentation was correct before
|
| + type_literal_(Unique<String>::CreateUninitialized(type_literal)) { } |
| - Handle<String> type_literal_; |
| + Unique<String> type_literal_; |
| bool compares_number_type_ : 1; |
|
Jakob Kummerow
2014/03/07 18:32:35
is this still used anywhere?
|
| + bool is_constant_value_ : 1; |
| + bool constant_check_success_ : 1; |
| }; |