| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
| 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 6414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6425 | 6425 |
| 6426 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 6426 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 6427 | 6427 |
| 6428 HObjectAccess access_; | 6428 HObjectAccess access_; |
| 6429 const UniqueSet<Map>* maps_; | 6429 const UniqueSet<Map>* maps_; |
| 6430 }; | 6430 }; |
| 6431 | 6431 |
| 6432 | 6432 |
| 6433 class HLoadNamedGeneric V8_FINAL : public HTemplateInstruction<2> { | 6433 class HLoadNamedGeneric V8_FINAL : public HTemplateInstruction<2> { |
| 6434 public: | 6434 public: |
| 6435 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*, | 6435 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadNamedGeneric, HValue*, |
| 6436 Handle<Object>); | 6436 Handle<Object>, bool); |
| 6437 | 6437 |
| 6438 HValue* context() const { return OperandAt(0); } | 6438 HValue* context() const { return OperandAt(0); } |
| 6439 HValue* object() const { return OperandAt(1); } | 6439 HValue* object() const { return OperandAt(1); } |
| 6440 Handle<Object> name() const { return name_; } | 6440 Handle<Object> name() const { return name_; } |
| 6441 | 6441 |
| 6442 int slot() const { | 6442 int slot() const { |
| 6443 DCHECK(FLAG_vector_ics && | 6443 DCHECK(FLAG_vector_ics && |
| 6444 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); | 6444 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); |
| 6445 return slot_; | 6445 return slot_; |
| 6446 } | 6446 } |
| 6447 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } | 6447 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } |
| 6448 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 6448 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { |
| 6449 DCHECK(FLAG_vector_ics); | 6449 DCHECK(FLAG_vector_ics); |
| 6450 feedback_vector_ = vector; | 6450 feedback_vector_ = vector; |
| 6451 slot_ = slot; | 6451 slot_ = slot; |
| 6452 } | 6452 } |
| 6453 bool is_own_property() { return is_own_property_; } |
| 6453 | 6454 |
| 6454 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 6455 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 6455 return Representation::Tagged(); | 6456 return Representation::Tagged(); |
| 6456 } | 6457 } |
| 6457 | 6458 |
| 6458 virtual OStream& PrintDataTo(OStream& os) const V8_OVERRIDE; // NOLINT | 6459 virtual OStream& PrintDataTo(OStream& os) const V8_OVERRIDE; // NOLINT |
| 6459 | 6460 |
| 6460 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) | 6461 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) |
| 6461 | 6462 |
| 6462 private: | 6463 private: |
| 6463 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) | 6464 HLoadNamedGeneric(HValue* context, HValue* object, |
| 6465 Handle<Object> name, bool is_own_property) |
| 6464 : name_(name), | 6466 : name_(name), |
| 6465 slot_(FeedbackSlotInterface::kInvalidFeedbackSlot) { | 6467 slot_(FeedbackSlotInterface::kInvalidFeedbackSlot), |
| 6468 is_own_property_(is_own_property) { |
| 6466 SetOperandAt(0, context); | 6469 SetOperandAt(0, context); |
| 6467 SetOperandAt(1, object); | 6470 SetOperandAt(1, object); |
| 6468 set_representation(Representation::Tagged()); | 6471 set_representation(Representation::Tagged()); |
| 6469 SetAllSideEffects(); | 6472 SetAllSideEffects(); |
| 6470 } | 6473 } |
| 6471 | 6474 |
| 6472 Handle<Object> name_; | 6475 Handle<Object> name_; |
| 6473 Handle<FixedArray> feedback_vector_; | 6476 Handle<FixedArray> feedback_vector_; |
| 6474 int slot_; | 6477 int slot_; |
| 6478 bool is_own_property_; |
| 6475 }; | 6479 }; |
| 6476 | 6480 |
| 6477 | 6481 |
| 6478 class HLoadFunctionPrototype V8_FINAL : public HUnaryOperation { | 6482 class HLoadFunctionPrototype V8_FINAL : public HUnaryOperation { |
| 6479 public: | 6483 public: |
| 6480 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); | 6484 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); |
| 6481 | 6485 |
| 6482 HValue* function() { return OperandAt(0); } | 6486 HValue* function() { return OperandAt(0); } |
| 6483 | 6487 |
| 6484 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 6488 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6705 {}; // NOLINT | 6709 {}; // NOLINT |
| 6706 class IsDehoistedField: | 6710 class IsDehoistedField: |
| 6707 public BitField<bool, kStartIsDehoisted, kBitsForIsDehoisted> | 6711 public BitField<bool, kStartIsDehoisted, kBitsForIsDehoisted> |
| 6708 {}; // NOLINT | 6712 {}; // NOLINT |
| 6709 uint32_t bit_field_; | 6713 uint32_t bit_field_; |
| 6710 }; | 6714 }; |
| 6711 | 6715 |
| 6712 | 6716 |
| 6713 class HLoadKeyedGeneric V8_FINAL : public HTemplateInstruction<3> { | 6717 class HLoadKeyedGeneric V8_FINAL : public HTemplateInstruction<3> { |
| 6714 public: | 6718 public: |
| 6715 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadKeyedGeneric, HValue*, | 6719 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadKeyedGeneric, HValue*, |
| 6716 HValue*); | 6720 HValue*, bool); |
| 6717 HValue* object() const { return OperandAt(0); } | 6721 HValue* object() const { return OperandAt(0); } |
| 6718 HValue* key() const { return OperandAt(1); } | 6722 HValue* key() const { return OperandAt(1); } |
| 6719 HValue* context() const { return OperandAt(2); } | 6723 HValue* context() const { return OperandAt(2); } |
| 6720 int slot() const { | 6724 int slot() const { |
| 6721 DCHECK(FLAG_vector_ics && | 6725 DCHECK(FLAG_vector_ics && |
| 6722 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); | 6726 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); |
| 6723 return slot_; | 6727 return slot_; |
| 6724 } | 6728 } |
| 6729 bool is_own_property() const { return is_own_property_; } |
| 6725 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } | 6730 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } |
| 6726 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 6731 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { |
| 6727 DCHECK(FLAG_vector_ics); | 6732 DCHECK(FLAG_vector_ics); |
| 6728 feedback_vector_ = vector; | 6733 feedback_vector_ = vector; |
| 6729 slot_ = slot; | 6734 slot_ = slot; |
| 6730 } | 6735 } |
| 6731 | 6736 |
| 6732 virtual OStream& PrintDataTo(OStream& os) const V8_OVERRIDE; // NOLINT | 6737 virtual OStream& PrintDataTo(OStream& os) const V8_OVERRIDE; // NOLINT |
| 6733 | 6738 |
| 6734 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 6739 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 6735 // tagged[tagged] | 6740 // tagged[tagged] |
| 6736 return Representation::Tagged(); | 6741 return Representation::Tagged(); |
| 6737 } | 6742 } |
| 6738 | 6743 |
| 6739 virtual HValue* Canonicalize() V8_OVERRIDE; | 6744 virtual HValue* Canonicalize() V8_OVERRIDE; |
| 6740 | 6745 |
| 6741 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) | 6746 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) |
| 6742 | 6747 |
| 6743 private: | 6748 private: |
| 6744 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key) | 6749 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key, bool is_own_prope
rty) |
| 6745 : slot_(FeedbackSlotInterface::kInvalidFeedbackSlot) { | 6750 : slot_(FeedbackSlotInterface::kInvalidFeedbackSlot), |
| 6751 is_own_property_(is_own_property) { |
| 6746 set_representation(Representation::Tagged()); | 6752 set_representation(Representation::Tagged()); |
| 6747 SetOperandAt(0, obj); | 6753 SetOperandAt(0, obj); |
| 6748 SetOperandAt(1, key); | 6754 SetOperandAt(1, key); |
| 6749 SetOperandAt(2, context); | 6755 SetOperandAt(2, context); |
| 6750 SetAllSideEffects(); | 6756 SetAllSideEffects(); |
| 6751 } | 6757 } |
| 6752 | 6758 |
| 6753 Handle<FixedArray> feedback_vector_; | 6759 Handle<FixedArray> feedback_vector_; |
| 6754 int slot_; | 6760 int slot_; |
| 6761 bool is_own_property_; |
| 6755 }; | 6762 }; |
| 6756 | 6763 |
| 6757 | 6764 |
| 6758 // Indicates whether the store is a store to an entry that was previously | 6765 // Indicates whether the store is a store to an entry that was previously |
| 6759 // initialized or not. | 6766 // initialized or not. |
| 6760 enum StoreFieldOrKeyedMode { | 6767 enum StoreFieldOrKeyedMode { |
| 6761 // The entry could be either previously initialized or not. | 6768 // The entry could be either previously initialized or not. |
| 6762 INITIALIZING_STORE, | 6769 INITIALIZING_STORE, |
| 6763 // At the time of this store it is guaranteed that the entry is already | 6770 // At the time of this store it is guaranteed that the entry is already |
| 6764 // initialized. | 6771 // initialized. |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7857 }; | 7864 }; |
| 7858 | 7865 |
| 7859 | 7866 |
| 7860 | 7867 |
| 7861 #undef DECLARE_INSTRUCTION | 7868 #undef DECLARE_INSTRUCTION |
| 7862 #undef DECLARE_CONCRETE_INSTRUCTION | 7869 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7863 | 7870 |
| 7864 } } // namespace v8::internal | 7871 } } // namespace v8::internal |
| 7865 | 7872 |
| 7866 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7873 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |