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 5478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5489 | 5489 |
5490 Handle<String> name_; | 5490 Handle<String> name_; |
5491 TypeofMode typeof_mode_; | 5491 TypeofMode typeof_mode_; |
5492 Handle<TypeFeedbackVector> feedback_vector_; | 5492 Handle<TypeFeedbackVector> feedback_vector_; |
5493 FeedbackVectorICSlot slot_; | 5493 FeedbackVectorICSlot slot_; |
5494 }; | 5494 }; |
5495 | 5495 |
5496 | 5496 |
5497 class HLoadGlobalViaContext final : public HTemplateInstruction<1> { | 5497 class HLoadGlobalViaContext final : public HTemplateInstruction<1> { |
5498 public: | 5498 public: |
5499 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalViaContext, | 5499 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadGlobalViaContext, int, int); |
5500 Handle<String>, int, int); | |
5501 | 5500 |
5502 HValue* context() { return OperandAt(0); } | 5501 HValue* context() { return OperandAt(0); } |
5503 Handle<String> name() const { return name_; } | |
5504 int depth() const { return depth_; } | 5502 int depth() const { return depth_; } |
5505 int slot_index() const { return slot_index_; } | 5503 int slot_index() const { return slot_index_; } |
5506 | 5504 |
5507 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 5505 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
5508 | 5506 |
5509 Representation RequiredInputRepresentation(int index) override { | 5507 Representation RequiredInputRepresentation(int index) override { |
5510 return Representation::Tagged(); | 5508 return Representation::Tagged(); |
5511 } | 5509 } |
5512 | 5510 |
5513 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalViaContext) | 5511 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalViaContext) |
5514 | 5512 |
5515 private: | 5513 private: |
5516 HLoadGlobalViaContext(HValue* context, Handle<String> name, int depth, | 5514 HLoadGlobalViaContext(HValue* context, int depth, int slot_index) |
5517 int slot_index) | 5515 : depth_(depth), slot_index_(slot_index) { |
5518 : name_(name), depth_(depth), slot_index_(slot_index) { | |
5519 SetOperandAt(0, context); | 5516 SetOperandAt(0, context); |
5520 set_representation(Representation::Tagged()); | 5517 set_representation(Representation::Tagged()); |
5521 SetAllSideEffects(); | 5518 SetAllSideEffects(); |
5522 } | 5519 } |
5523 | 5520 |
5524 Handle<String> name_; | 5521 int const depth_; |
5525 int depth_; | 5522 int const slot_index_; |
5526 int slot_index_; | |
5527 }; | 5523 }; |
5528 | 5524 |
5529 | 5525 |
5530 class HAllocate final : public HTemplateInstruction<2> { | 5526 class HAllocate final : public HTemplateInstruction<2> { |
5531 public: | 5527 public: |
5532 static bool CompatibleInstanceTypes(InstanceType type1, | 5528 static bool CompatibleInstanceTypes(InstanceType type1, |
5533 InstanceType type2) { | 5529 InstanceType type2) { |
5534 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && | 5530 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && |
5535 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); | 5531 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); |
5536 } | 5532 } |
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7062 Handle<Name> name_; | 7058 Handle<Name> name_; |
7063 Handle<TypeFeedbackVector> feedback_vector_; | 7059 Handle<TypeFeedbackVector> feedback_vector_; |
7064 FeedbackVectorICSlot slot_; | 7060 FeedbackVectorICSlot slot_; |
7065 LanguageMode language_mode_; | 7061 LanguageMode language_mode_; |
7066 InlineCacheState initialization_state_; | 7062 InlineCacheState initialization_state_; |
7067 }; | 7063 }; |
7068 | 7064 |
7069 | 7065 |
7070 class HStoreGlobalViaContext final : public HTemplateInstruction<2> { | 7066 class HStoreGlobalViaContext final : public HTemplateInstruction<2> { |
7071 public: | 7067 public: |
7072 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(HStoreGlobalViaContext, | 7068 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreGlobalViaContext, HValue*, |
7073 Handle<String>, HValue*, int, int, | 7069 int, int, LanguageMode); |
7074 LanguageMode); | |
7075 HValue* context() const { return OperandAt(0); } | 7070 HValue* context() const { return OperandAt(0); } |
7076 HValue* value() const { return OperandAt(1); } | 7071 HValue* value() const { return OperandAt(1); } |
7077 Handle<String> name() const { return name_; } | |
7078 int depth() const { return depth_; } | 7072 int depth() const { return depth_; } |
7079 int slot_index() const { return slot_index_; } | 7073 int slot_index() const { return slot_index_; } |
7080 LanguageMode language_mode() const { return language_mode_; } | 7074 LanguageMode language_mode() const { return language_mode_; } |
7081 | 7075 |
7082 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 7076 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
7083 | 7077 |
7084 Representation RequiredInputRepresentation(int index) override { | 7078 Representation RequiredInputRepresentation(int index) override { |
7085 return Representation::Tagged(); | 7079 return Representation::Tagged(); |
7086 } | 7080 } |
7087 | 7081 |
7088 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalViaContext) | 7082 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalViaContext) |
7089 | 7083 |
7090 private: | 7084 private: |
7091 HStoreGlobalViaContext(HValue* context, Handle<String> name, HValue* value, | 7085 HStoreGlobalViaContext(HValue* context, HValue* value, int depth, |
7092 int depth, int slot_index, LanguageMode language_mode) | 7086 int slot_index, LanguageMode language_mode) |
7093 : name_(name), | 7087 : depth_(depth), slot_index_(slot_index), language_mode_(language_mode) { |
7094 depth_(depth), | |
7095 slot_index_(slot_index), | |
7096 language_mode_(language_mode) { | |
7097 SetOperandAt(0, context); | 7088 SetOperandAt(0, context); |
7098 SetOperandAt(1, value); | 7089 SetOperandAt(1, value); |
7099 SetAllSideEffects(); | 7090 SetAllSideEffects(); |
7100 } | 7091 } |
7101 | 7092 |
7102 Handle<String> name_; | 7093 int const depth_; |
7103 int depth_; | 7094 int const slot_index_; |
7104 int slot_index_; | 7095 LanguageMode const language_mode_; |
7105 LanguageMode language_mode_; | |
7106 }; | 7096 }; |
7107 | 7097 |
7108 | 7098 |
7109 class HStoreKeyed final : public HTemplateInstruction<3>, | 7099 class HStoreKeyed final : public HTemplateInstruction<3>, |
7110 public ArrayInstructionInterface { | 7100 public ArrayInstructionInterface { |
7111 public: | 7101 public: |
7112 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, | 7102 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, |
7113 ElementsKind); | 7103 ElementsKind); |
7114 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, | 7104 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, |
7115 ElementsKind, StoreFieldOrKeyedMode); | 7105 ElementsKind, StoreFieldOrKeyedMode); |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8095 }; | 8085 }; |
8096 | 8086 |
8097 | 8087 |
8098 | 8088 |
8099 #undef DECLARE_INSTRUCTION | 8089 #undef DECLARE_INSTRUCTION |
8100 #undef DECLARE_CONCRETE_INSTRUCTION | 8090 #undef DECLARE_CONCRETE_INSTRUCTION |
8101 | 8091 |
8102 } } // namespace v8::internal | 8092 } } // namespace v8::internal |
8103 | 8093 |
8104 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 8094 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |