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