| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 6495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6506 return new(zone) HTransitionElementsKind(context, object, | 6506 return new(zone) HTransitionElementsKind(context, object, |
| 6507 original_map, transitioned_map); | 6507 original_map, transitioned_map); |
| 6508 } | 6508 } |
| 6509 | 6509 |
| 6510 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 6510 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 6511 return Representation::Tagged(); | 6511 return Representation::Tagged(); |
| 6512 } | 6512 } |
| 6513 | 6513 |
| 6514 HValue* object() { return OperandAt(0); } | 6514 HValue* object() { return OperandAt(0); } |
| 6515 HValue* context() { return OperandAt(1); } | 6515 HValue* context() { return OperandAt(1); } |
| 6516 Handle<Map> original_map() { return original_map_; } | 6516 Unique<Map> original_map() { return original_map_; } |
| 6517 Handle<Map> transitioned_map() { return transitioned_map_; } | 6517 Unique<Map> transitioned_map() { return transitioned_map_; } |
| 6518 ElementsKind from_kind() { return from_kind_; } | 6518 ElementsKind from_kind() { return from_kind_; } |
| 6519 ElementsKind to_kind() { return to_kind_; } | 6519 ElementsKind to_kind() { return to_kind_; } |
| 6520 | 6520 |
| 6521 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 6521 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 6522 | 6522 |
| 6523 virtual void FinalizeUniqueValueId() V8_OVERRIDE { | |
| 6524 original_map_unique_id_ = UniqueValueId(original_map_); | |
| 6525 transitioned_map_unique_id_ = UniqueValueId(transitioned_map_); | |
| 6526 } | |
| 6527 | |
| 6528 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind) | 6523 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind) |
| 6529 | 6524 |
| 6530 protected: | 6525 protected: |
| 6531 virtual bool DataEquals(HValue* other) V8_OVERRIDE { | 6526 virtual bool DataEquals(HValue* other) V8_OVERRIDE { |
| 6532 HTransitionElementsKind* instr = HTransitionElementsKind::cast(other); | 6527 HTransitionElementsKind* instr = HTransitionElementsKind::cast(other); |
| 6533 return original_map_unique_id_ == instr->original_map_unique_id_ && | 6528 return original_map_ == instr->original_map_ && |
| 6534 transitioned_map_unique_id_ == instr->transitioned_map_unique_id_; | 6529 transitioned_map_ == instr->transitioned_map_; |
| 6535 } | 6530 } |
| 6536 | 6531 |
| 6537 private: | 6532 private: |
| 6538 HTransitionElementsKind(HValue* context, | 6533 HTransitionElementsKind(HValue* context, |
| 6539 HValue* object, | 6534 HValue* object, |
| 6540 Handle<Map> original_map, | 6535 Handle<Map> original_map, |
| 6541 Handle<Map> transitioned_map) | 6536 Handle<Map> transitioned_map) |
| 6542 : original_map_(original_map), | 6537 : original_map_(Unique<Map>(original_map)), |
| 6543 transitioned_map_(transitioned_map), | 6538 transitioned_map_(Unique<Map>(transitioned_map)), |
| 6544 original_map_unique_id_(), | |
| 6545 transitioned_map_unique_id_(), | |
| 6546 from_kind_(original_map->elements_kind()), | 6539 from_kind_(original_map->elements_kind()), |
| 6547 to_kind_(transitioned_map->elements_kind()) { | 6540 to_kind_(transitioned_map->elements_kind()) { |
| 6548 SetOperandAt(0, object); | 6541 SetOperandAt(0, object); |
| 6549 SetOperandAt(1, context); | 6542 SetOperandAt(1, context); |
| 6550 SetFlag(kUseGVN); | 6543 SetFlag(kUseGVN); |
| 6551 SetGVNFlag(kChangesElementsKind); | 6544 SetGVNFlag(kChangesElementsKind); |
| 6552 if (!IsSimpleMapChangeTransition(from_kind_, to_kind_)) { | 6545 if (!IsSimpleMapChangeTransition(from_kind_, to_kind_)) { |
| 6553 SetGVNFlag(kChangesElementsPointer); | 6546 SetGVNFlag(kChangesElementsPointer); |
| 6554 SetGVNFlag(kChangesNewSpacePromotion); | 6547 SetGVNFlag(kChangesNewSpacePromotion); |
| 6555 } | 6548 } |
| 6556 set_representation(Representation::Tagged()); | 6549 set_representation(Representation::Tagged()); |
| 6557 } | 6550 } |
| 6558 | 6551 |
| 6559 Handle<Map> original_map_; | 6552 Unique<Map> original_map_; |
| 6560 Handle<Map> transitioned_map_; | 6553 Unique<Map> transitioned_map_; |
| 6561 UniqueValueId original_map_unique_id_; | |
| 6562 UniqueValueId transitioned_map_unique_id_; | |
| 6563 ElementsKind from_kind_; | 6554 ElementsKind from_kind_; |
| 6564 ElementsKind to_kind_; | 6555 ElementsKind to_kind_; |
| 6565 }; | 6556 }; |
| 6566 | 6557 |
| 6567 | 6558 |
| 6568 class HStringAdd V8_FINAL : public HBinaryOperation { | 6559 class HStringAdd V8_FINAL : public HBinaryOperation { |
| 6569 public: | 6560 public: |
| 6570 static HInstruction* New(Zone* zone, | 6561 static HInstruction* New(Zone* zone, |
| 6571 HValue* context, | 6562 HValue* context, |
| 6572 HValue* left, | 6563 HValue* left, |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7071 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7062 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 7072 }; | 7063 }; |
| 7073 | 7064 |
| 7074 | 7065 |
| 7075 #undef DECLARE_INSTRUCTION | 7066 #undef DECLARE_INSTRUCTION |
| 7076 #undef DECLARE_CONCRETE_INSTRUCTION | 7067 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7077 | 7068 |
| 7078 } } // namespace v8::internal | 7069 } } // namespace v8::internal |
| 7079 | 7070 |
| 7080 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7071 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |