| 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 6375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_P3(HLoadNamedGeneric, HValue*, |
| 6396 Handle<Object>, InlineCacheState); | 6396 Handle<Name>, InlineCacheState); |
| 6397 | 6397 |
| 6398 HValue* context() const { return OperandAt(0); } | 6398 HValue* context() const { return OperandAt(0); } |
| 6399 HValue* object() const { return OperandAt(1); } | 6399 HValue* object() const { return OperandAt(1); } |
| 6400 Handle<Object> name() const { return name_; } | 6400 Handle<Name> name() const { return name_; } |
| 6401 | 6401 |
| 6402 InlineCacheState initialization_state() const { | 6402 InlineCacheState initialization_state() const { |
| 6403 return initialization_state_; | 6403 return initialization_state_; |
| 6404 } | 6404 } |
| 6405 FeedbackVectorICSlot slot() const { return slot_; } | 6405 FeedbackVectorICSlot slot() const { return slot_; } |
| 6406 Handle<TypeFeedbackVector> feedback_vector() const { | 6406 Handle<TypeFeedbackVector> feedback_vector() const { |
| 6407 return feedback_vector_; | 6407 return feedback_vector_; |
| 6408 } | 6408 } |
| 6409 bool HasVectorAndSlot() const { return true; } | 6409 bool HasVectorAndSlot() const { return true; } |
| 6410 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, | 6410 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, |
| 6411 FeedbackVectorICSlot slot) { | 6411 FeedbackVectorICSlot slot) { |
| 6412 feedback_vector_ = vector; | 6412 feedback_vector_ = vector; |
| 6413 slot_ = slot; | 6413 slot_ = slot; |
| 6414 } | 6414 } |
| 6415 | 6415 |
| 6416 Representation RequiredInputRepresentation(int index) override { | 6416 Representation RequiredInputRepresentation(int index) override { |
| 6417 return Representation::Tagged(); | 6417 return Representation::Tagged(); |
| 6418 } | 6418 } |
| 6419 | 6419 |
| 6420 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 6420 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
| 6421 | 6421 |
| 6422 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) | 6422 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) |
| 6423 | 6423 |
| 6424 private: | 6424 private: |
| 6425 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name, | 6425 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Name> name, |
| 6426 InlineCacheState initialization_state) | 6426 InlineCacheState initialization_state) |
| 6427 : name_(name), | 6427 : name_(name), |
| 6428 slot_(FeedbackVectorICSlot::Invalid()), | 6428 slot_(FeedbackVectorICSlot::Invalid()), |
| 6429 initialization_state_(initialization_state) { | 6429 initialization_state_(initialization_state) { |
| 6430 SetOperandAt(0, context); | 6430 SetOperandAt(0, context); |
| 6431 SetOperandAt(1, object); | 6431 SetOperandAt(1, object); |
| 6432 set_representation(Representation::Tagged()); | 6432 set_representation(Representation::Tagged()); |
| 6433 SetAllSideEffects(); | 6433 SetAllSideEffects(); |
| 6434 } | 6434 } |
| 6435 | 6435 |
| 6436 Handle<Object> name_; | 6436 Handle<Name> name_; |
| 6437 Handle<TypeFeedbackVector> feedback_vector_; | 6437 Handle<TypeFeedbackVector> feedback_vector_; |
| 6438 FeedbackVectorICSlot slot_; | 6438 FeedbackVectorICSlot slot_; |
| 6439 InlineCacheState initialization_state_; | 6439 InlineCacheState initialization_state_; |
| 6440 }; | 6440 }; |
| 6441 | 6441 |
| 6442 | 6442 |
| 6443 class HLoadFunctionPrototype final : public HUnaryOperation { | 6443 class HLoadFunctionPrototype final : public HUnaryOperation { |
| 6444 public: | 6444 public: |
| 6445 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); | 6445 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); |
| 6446 | 6446 |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6881 | 6881 |
| 6882 HObjectAccess access_; | 6882 HObjectAccess access_; |
| 6883 HValue* dominator_; | 6883 HValue* dominator_; |
| 6884 uint32_t bit_field_; | 6884 uint32_t bit_field_; |
| 6885 }; | 6885 }; |
| 6886 | 6886 |
| 6887 | 6887 |
| 6888 class HStoreNamedGeneric final : public HTemplateInstruction<3> { | 6888 class HStoreNamedGeneric final : public HTemplateInstruction<3> { |
| 6889 public: | 6889 public: |
| 6890 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(HStoreNamedGeneric, HValue*, | 6890 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(HStoreNamedGeneric, HValue*, |
| 6891 Handle<String>, HValue*, | 6891 Handle<Name>, HValue*, |
| 6892 LanguageMode, InlineCacheState); | 6892 LanguageMode, InlineCacheState); |
| 6893 HValue* object() const { return OperandAt(0); } | 6893 HValue* object() const { return OperandAt(0); } |
| 6894 HValue* value() const { return OperandAt(1); } | 6894 HValue* value() const { return OperandAt(1); } |
| 6895 HValue* context() const { return OperandAt(2); } | 6895 HValue* context() const { return OperandAt(2); } |
| 6896 Handle<String> name() const { return name_; } | 6896 Handle<Name> name() const { return name_; } |
| 6897 LanguageMode language_mode() const { return language_mode_; } | 6897 LanguageMode language_mode() const { return language_mode_; } |
| 6898 InlineCacheState initialization_state() const { | 6898 InlineCacheState initialization_state() const { |
| 6899 return initialization_state_; | 6899 return initialization_state_; |
| 6900 } | 6900 } |
| 6901 | 6901 |
| 6902 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 6902 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
| 6903 | 6903 |
| 6904 Representation RequiredInputRepresentation(int index) override { | 6904 Representation RequiredInputRepresentation(int index) override { |
| 6905 return Representation::Tagged(); | 6905 return Representation::Tagged(); |
| 6906 } | 6906 } |
| 6907 | 6907 |
| 6908 FeedbackVectorICSlot slot() const { return slot_; } |
| 6909 Handle<TypeFeedbackVector> feedback_vector() const { |
| 6910 return feedback_vector_; |
| 6911 } |
| 6912 bool HasVectorAndSlot() const { return FLAG_vector_stores; } |
| 6913 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, |
| 6914 FeedbackVectorICSlot slot) { |
| 6915 feedback_vector_ = vector; |
| 6916 slot_ = slot; |
| 6917 } |
| 6918 |
| 6908 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) | 6919 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) |
| 6909 | 6920 |
| 6910 private: | 6921 private: |
| 6911 HStoreNamedGeneric(HValue* context, HValue* object, Handle<String> name, | 6922 HStoreNamedGeneric(HValue* context, HValue* object, Handle<Name> name, |
| 6912 HValue* value, LanguageMode language_mode, | 6923 HValue* value, LanguageMode language_mode, |
| 6913 InlineCacheState initialization_state) | 6924 InlineCacheState initialization_state) |
| 6914 : name_(name), | 6925 : name_(name), |
| 6926 slot_(FeedbackVectorICSlot::Invalid()), |
| 6915 language_mode_(language_mode), | 6927 language_mode_(language_mode), |
| 6916 initialization_state_(initialization_state) { | 6928 initialization_state_(initialization_state) { |
| 6917 SetOperandAt(0, object); | 6929 SetOperandAt(0, object); |
| 6918 SetOperandAt(1, value); | 6930 SetOperandAt(1, value); |
| 6919 SetOperandAt(2, context); | 6931 SetOperandAt(2, context); |
| 6920 SetAllSideEffects(); | 6932 SetAllSideEffects(); |
| 6921 } | 6933 } |
| 6922 | 6934 |
| 6923 Handle<String> name_; | 6935 Handle<Name> name_; |
| 6936 Handle<TypeFeedbackVector> feedback_vector_; |
| 6937 FeedbackVectorICSlot slot_; |
| 6924 LanguageMode language_mode_; | 6938 LanguageMode language_mode_; |
| 6925 InlineCacheState initialization_state_; | 6939 InlineCacheState initialization_state_; |
| 6926 }; | 6940 }; |
| 6927 | 6941 |
| 6928 | 6942 |
| 6929 class HStoreKeyed final : public HTemplateInstruction<3>, | 6943 class HStoreKeyed final : public HTemplateInstruction<3>, |
| 6930 public ArrayInstructionInterface { | 6944 public ArrayInstructionInterface { |
| 6931 public: | 6945 public: |
| 6932 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, | 6946 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, |
| 6933 ElementsKind); | 6947 ElementsKind); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7123 LanguageMode language_mode() const { return language_mode_; } | 7137 LanguageMode language_mode() const { return language_mode_; } |
| 7124 InlineCacheState initialization_state() const { | 7138 InlineCacheState initialization_state() const { |
| 7125 return initialization_state_; | 7139 return initialization_state_; |
| 7126 } | 7140 } |
| 7127 | 7141 |
| 7128 Representation RequiredInputRepresentation(int index) override { | 7142 Representation RequiredInputRepresentation(int index) override { |
| 7129 // tagged[tagged] = tagged | 7143 // tagged[tagged] = tagged |
| 7130 return Representation::Tagged(); | 7144 return Representation::Tagged(); |
| 7131 } | 7145 } |
| 7132 | 7146 |
| 7147 FeedbackVectorICSlot slot() const { return slot_; } |
| 7148 Handle<TypeFeedbackVector> feedback_vector() const { |
| 7149 return feedback_vector_; |
| 7150 } |
| 7151 bool HasVectorAndSlot() const { |
| 7152 DCHECK(!(FLAG_vector_stores && initialization_state_ != MEGAMORPHIC) || |
| 7153 !feedback_vector_.is_null()); |
| 7154 return !feedback_vector_.is_null(); |
| 7155 } |
| 7156 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, |
| 7157 FeedbackVectorICSlot slot) { |
| 7158 feedback_vector_ = vector; |
| 7159 slot_ = slot; |
| 7160 } |
| 7161 |
| 7133 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 7162 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
| 7134 | 7163 |
| 7135 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric) | 7164 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric) |
| 7136 | 7165 |
| 7137 private: | 7166 private: |
| 7138 HStoreKeyedGeneric(HValue* context, HValue* object, HValue* key, | 7167 HStoreKeyedGeneric(HValue* context, HValue* object, HValue* key, |
| 7139 HValue* value, LanguageMode language_mode, | 7168 HValue* value, LanguageMode language_mode, |
| 7140 InlineCacheState initialization_state) | 7169 InlineCacheState initialization_state) |
| 7141 : language_mode_(language_mode), | 7170 : slot_(FeedbackVectorICSlot::Invalid()), |
| 7171 language_mode_(language_mode), |
| 7142 initialization_state_(initialization_state) { | 7172 initialization_state_(initialization_state) { |
| 7143 SetOperandAt(0, object); | 7173 SetOperandAt(0, object); |
| 7144 SetOperandAt(1, key); | 7174 SetOperandAt(1, key); |
| 7145 SetOperandAt(2, value); | 7175 SetOperandAt(2, value); |
| 7146 SetOperandAt(3, context); | 7176 SetOperandAt(3, context); |
| 7147 SetAllSideEffects(); | 7177 SetAllSideEffects(); |
| 7148 } | 7178 } |
| 7149 | 7179 |
| 7180 Handle<TypeFeedbackVector> feedback_vector_; |
| 7181 FeedbackVectorICSlot slot_; |
| 7150 LanguageMode language_mode_; | 7182 LanguageMode language_mode_; |
| 7151 InlineCacheState initialization_state_; | 7183 InlineCacheState initialization_state_; |
| 7152 }; | 7184 }; |
| 7153 | 7185 |
| 7154 | 7186 |
| 7155 class HTransitionElementsKind final : public HTemplateInstruction<2> { | 7187 class HTransitionElementsKind final : public HTemplateInstruction<2> { |
| 7156 public: | 7188 public: |
| 7157 inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone, | 7189 inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone, |
| 7158 HValue* context, HValue* object, | 7190 HValue* context, HValue* object, |
| 7159 Handle<Map> original_map, | 7191 Handle<Map> original_map, |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7897 }; | 7929 }; |
| 7898 | 7930 |
| 7899 | 7931 |
| 7900 | 7932 |
| 7901 #undef DECLARE_INSTRUCTION | 7933 #undef DECLARE_INSTRUCTION |
| 7902 #undef DECLARE_CONCRETE_INSTRUCTION | 7934 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7903 | 7935 |
| 7904 } } // namespace v8::internal | 7936 } } // namespace v8::internal |
| 7905 | 7937 |
| 7906 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7938 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |