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 <cstring> | 8 #include <cstring> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 | 10 |
(...skipping 6374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6385 | 6385 |
6386 bool IsDeletable() const override { return true; } | 6386 bool IsDeletable() const override { return true; } |
6387 | 6387 |
6388 HObjectAccess access_; | 6388 HObjectAccess access_; |
6389 const UniqueSet<Map>* maps_; | 6389 const UniqueSet<Map>* maps_; |
6390 }; | 6390 }; |
6391 | 6391 |
6392 | 6392 |
6393 class HLoadNamedGeneric final : public HTemplateInstruction<2> { | 6393 class HLoadNamedGeneric final : public HTemplateInstruction<2> { |
6394 public: | 6394 public: |
6395 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HLoadNamedGeneric, HValue*, | 6395 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadNamedGeneric, HValue*, |
6396 Handle<Object>, LanguageMode, | 6396 Handle<Object>, InlineCacheState); |
6397 InlineCacheState); | |
6398 | 6397 |
6399 HValue* context() const { return OperandAt(0); } | 6398 HValue* context() const { return OperandAt(0); } |
6400 HValue* object() const { return OperandAt(1); } | 6399 HValue* object() const { return OperandAt(1); } |
6401 Handle<Object> name() const { return name_; } | 6400 Handle<Object> name() const { return name_; } |
6402 | 6401 |
6403 InlineCacheState initialization_state() const { | 6402 InlineCacheState initialization_state() const { |
6404 return initialization_state_; | 6403 return initialization_state_; |
6405 } | 6404 } |
6406 FeedbackVectorICSlot slot() const { return slot_; } | 6405 FeedbackVectorICSlot slot() const { return slot_; } |
6407 Handle<TypeFeedbackVector> feedback_vector() const { | 6406 Handle<TypeFeedbackVector> feedback_vector() const { |
6408 return feedback_vector_; | 6407 return feedback_vector_; |
6409 } | 6408 } |
6410 bool HasVectorAndSlot() const { return true; } | 6409 bool HasVectorAndSlot() const { return true; } |
6411 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, | 6410 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, |
6412 FeedbackVectorICSlot slot) { | 6411 FeedbackVectorICSlot slot) { |
6413 feedback_vector_ = vector; | 6412 feedback_vector_ = vector; |
6414 slot_ = slot; | 6413 slot_ = slot; |
6415 } | 6414 } |
6416 | 6415 |
6417 Representation RequiredInputRepresentation(int index) override { | 6416 Representation RequiredInputRepresentation(int index) override { |
6418 return Representation::Tagged(); | 6417 return Representation::Tagged(); |
6419 } | 6418 } |
6420 | 6419 |
6421 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 6420 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
6422 | 6421 |
6423 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) | 6422 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) |
6424 | 6423 |
6425 LanguageMode language_mode() const { return language_mode_; } | |
6426 | |
6427 private: | 6424 private: |
6428 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name, | 6425 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name, |
6429 LanguageMode language_mode, | |
6430 InlineCacheState initialization_state) | 6426 InlineCacheState initialization_state) |
6431 : name_(name), | 6427 : name_(name), |
6432 slot_(FeedbackVectorICSlot::Invalid()), | 6428 slot_(FeedbackVectorICSlot::Invalid()), |
6433 language_mode_(language_mode), | |
6434 initialization_state_(initialization_state) { | 6429 initialization_state_(initialization_state) { |
6435 SetOperandAt(0, context); | 6430 SetOperandAt(0, context); |
6436 SetOperandAt(1, object); | 6431 SetOperandAt(1, object); |
6437 set_representation(Representation::Tagged()); | 6432 set_representation(Representation::Tagged()); |
6438 SetAllSideEffects(); | 6433 SetAllSideEffects(); |
6439 } | 6434 } |
6440 | 6435 |
6441 Handle<Object> name_; | 6436 Handle<Object> name_; |
6442 Handle<TypeFeedbackVector> feedback_vector_; | 6437 Handle<TypeFeedbackVector> feedback_vector_; |
6443 FeedbackVectorICSlot slot_; | 6438 FeedbackVectorICSlot slot_; |
6444 LanguageMode language_mode_; | |
6445 InlineCacheState initialization_state_; | 6439 InlineCacheState initialization_state_; |
6446 }; | 6440 }; |
6447 | 6441 |
6448 | 6442 |
6449 class HLoadFunctionPrototype final : public HUnaryOperation { | 6443 class HLoadFunctionPrototype final : public HUnaryOperation { |
6450 public: | 6444 public: |
6451 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); | 6445 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); |
6452 | 6446 |
6453 HValue* function() { return OperandAt(0); } | 6447 HValue* function() { return OperandAt(0); } |
6454 | 6448 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6674 {}; // NOLINT | 6668 {}; // NOLINT |
6675 class IsDehoistedField: | 6669 class IsDehoistedField: |
6676 public BitField<bool, kStartIsDehoisted, kBitsForIsDehoisted> | 6670 public BitField<bool, kStartIsDehoisted, kBitsForIsDehoisted> |
6677 {}; // NOLINT | 6671 {}; // NOLINT |
6678 uint32_t bit_field_; | 6672 uint32_t bit_field_; |
6679 }; | 6673 }; |
6680 | 6674 |
6681 | 6675 |
6682 class HLoadKeyedGeneric final : public HTemplateInstruction<3> { | 6676 class HLoadKeyedGeneric final : public HTemplateInstruction<3> { |
6683 public: | 6677 public: |
6684 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HLoadKeyedGeneric, HValue*, | 6678 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadKeyedGeneric, HValue*, |
6685 HValue*, LanguageMode, | 6679 HValue*, InlineCacheState); |
6686 InlineCacheState); | |
6687 HValue* object() const { return OperandAt(0); } | 6680 HValue* object() const { return OperandAt(0); } |
6688 HValue* key() const { return OperandAt(1); } | 6681 HValue* key() const { return OperandAt(1); } |
6689 HValue* context() const { return OperandAt(2); } | 6682 HValue* context() const { return OperandAt(2); } |
6690 InlineCacheState initialization_state() const { | 6683 InlineCacheState initialization_state() const { |
6691 return initialization_state_; | 6684 return initialization_state_; |
6692 } | 6685 } |
6693 FeedbackVectorICSlot slot() const { return slot_; } | 6686 FeedbackVectorICSlot slot() const { return slot_; } |
6694 Handle<TypeFeedbackVector> feedback_vector() const { | 6687 Handle<TypeFeedbackVector> feedback_vector() const { |
6695 return feedback_vector_; | 6688 return feedback_vector_; |
6696 } | 6689 } |
(...skipping 11 matching lines...) Expand all Loading... |
6708 | 6701 |
6709 Representation RequiredInputRepresentation(int index) override { | 6702 Representation RequiredInputRepresentation(int index) override { |
6710 // tagged[tagged] | 6703 // tagged[tagged] |
6711 return Representation::Tagged(); | 6704 return Representation::Tagged(); |
6712 } | 6705 } |
6713 | 6706 |
6714 HValue* Canonicalize() override; | 6707 HValue* Canonicalize() override; |
6715 | 6708 |
6716 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) | 6709 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) |
6717 | 6710 |
6718 LanguageMode language_mode() const { return language_mode_; } | |
6719 | |
6720 private: | 6711 private: |
6721 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key, | 6712 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key, |
6722 LanguageMode language_mode, | |
6723 InlineCacheState initialization_state) | 6713 InlineCacheState initialization_state) |
6724 : slot_(FeedbackVectorICSlot::Invalid()), | 6714 : slot_(FeedbackVectorICSlot::Invalid()), |
6725 initialization_state_(initialization_state), | 6715 initialization_state_(initialization_state) { |
6726 language_mode_(language_mode) { | |
6727 set_representation(Representation::Tagged()); | 6716 set_representation(Representation::Tagged()); |
6728 SetOperandAt(0, obj); | 6717 SetOperandAt(0, obj); |
6729 SetOperandAt(1, key); | 6718 SetOperandAt(1, key); |
6730 SetOperandAt(2, context); | 6719 SetOperandAt(2, context); |
6731 SetAllSideEffects(); | 6720 SetAllSideEffects(); |
6732 } | 6721 } |
6733 | 6722 |
6734 Handle<TypeFeedbackVector> feedback_vector_; | 6723 Handle<TypeFeedbackVector> feedback_vector_; |
6735 FeedbackVectorICSlot slot_; | 6724 FeedbackVectorICSlot slot_; |
6736 InlineCacheState initialization_state_; | 6725 InlineCacheState initialization_state_; |
6737 LanguageMode language_mode_; | |
6738 }; | 6726 }; |
6739 | 6727 |
6740 | 6728 |
6741 // Indicates whether the store is a store to an entry that was previously | 6729 // Indicates whether the store is a store to an entry that was previously |
6742 // initialized or not. | 6730 // initialized or not. |
6743 enum StoreFieldOrKeyedMode { | 6731 enum StoreFieldOrKeyedMode { |
6744 // The entry could be either previously initialized or not. | 6732 // The entry could be either previously initialized or not. |
6745 INITIALIZING_STORE, | 6733 INITIALIZING_STORE, |
6746 // At the time of this store it is guaranteed that the entry is already | 6734 // At the time of this store it is guaranteed that the entry is already |
6747 // initialized. | 6735 // initialized. |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7909 }; | 7897 }; |
7910 | 7898 |
7911 | 7899 |
7912 | 7900 |
7913 #undef DECLARE_INSTRUCTION | 7901 #undef DECLARE_INSTRUCTION |
7914 #undef DECLARE_CONCRETE_INSTRUCTION | 7902 #undef DECLARE_CONCRETE_INSTRUCTION |
7915 | 7903 |
7916 } } // namespace v8::internal | 7904 } } // namespace v8::internal |
7917 | 7905 |
7918 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7906 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |