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