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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 V(IsConstructCallAndBranch) \ | 112 V(IsConstructCallAndBranch) \ |
113 V(IsObjectAndBranch) \ | 113 V(IsObjectAndBranch) \ |
114 V(IsStringAndBranch) \ | 114 V(IsStringAndBranch) \ |
115 V(IsSmiAndBranch) \ | 115 V(IsSmiAndBranch) \ |
116 V(IsUndetectableAndBranch) \ | 116 V(IsUndetectableAndBranch) \ |
117 V(LeaveInlined) \ | 117 V(LeaveInlined) \ |
118 V(LoadContextSlot) \ | 118 V(LoadContextSlot) \ |
119 V(LoadFieldByIndex) \ | 119 V(LoadFieldByIndex) \ |
120 V(LoadFunctionPrototype) \ | 120 V(LoadFunctionPrototype) \ |
121 V(LoadGlobalGeneric) \ | 121 V(LoadGlobalGeneric) \ |
| 122 V(LoadGlobalViaContext) \ |
122 V(LoadKeyed) \ | 123 V(LoadKeyed) \ |
123 V(LoadKeyedGeneric) \ | 124 V(LoadKeyedGeneric) \ |
124 V(LoadNamedField) \ | 125 V(LoadNamedField) \ |
125 V(LoadNamedGeneric) \ | 126 V(LoadNamedGeneric) \ |
126 V(LoadRoot) \ | 127 V(LoadRoot) \ |
127 V(MapEnumLength) \ | 128 V(MapEnumLength) \ |
128 V(MathFloorOfDiv) \ | 129 V(MathFloorOfDiv) \ |
129 V(MathMinMax) \ | 130 V(MathMinMax) \ |
130 V(MaybeGrowElements) \ | 131 V(MaybeGrowElements) \ |
131 V(Mod) \ | 132 V(Mod) \ |
132 V(Mul) \ | 133 V(Mul) \ |
133 V(OsrEntry) \ | 134 V(OsrEntry) \ |
134 V(Parameter) \ | 135 V(Parameter) \ |
135 V(Power) \ | 136 V(Power) \ |
136 V(PushArguments) \ | 137 V(PushArguments) \ |
137 V(RegExpLiteral) \ | 138 V(RegExpLiteral) \ |
138 V(Return) \ | 139 V(Return) \ |
139 V(Ror) \ | 140 V(Ror) \ |
140 V(Sar) \ | 141 V(Sar) \ |
141 V(SeqStringGetChar) \ | 142 V(SeqStringGetChar) \ |
142 V(SeqStringSetChar) \ | 143 V(SeqStringSetChar) \ |
143 V(Shl) \ | 144 V(Shl) \ |
144 V(Shr) \ | 145 V(Shr) \ |
145 V(Simulate) \ | 146 V(Simulate) \ |
146 V(StackCheck) \ | 147 V(StackCheck) \ |
147 V(StoreCodeEntry) \ | 148 V(StoreCodeEntry) \ |
148 V(StoreContextSlot) \ | 149 V(StoreContextSlot) \ |
149 V(StoreFrameContext) \ | 150 V(StoreFrameContext) \ |
| 151 V(StoreGlobalViaContext) \ |
150 V(StoreKeyed) \ | 152 V(StoreKeyed) \ |
151 V(StoreKeyedGeneric) \ | 153 V(StoreKeyedGeneric) \ |
152 V(StoreNamedField) \ | 154 V(StoreNamedField) \ |
153 V(StoreNamedGeneric) \ | 155 V(StoreNamedGeneric) \ |
154 V(StringAdd) \ | 156 V(StringAdd) \ |
155 V(StringCharCodeAt) \ | 157 V(StringCharCodeAt) \ |
156 V(StringCharFromCode) \ | 158 V(StringCharFromCode) \ |
157 V(StringCompareAndBranch) \ | 159 V(StringCompareAndBranch) \ |
158 V(Sub) \ | 160 V(Sub) \ |
159 V(ThisFunction) \ | 161 V(ThisFunction) \ |
(...skipping 5278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5438 SetAllSideEffects(); | 5440 SetAllSideEffects(); |
5439 } | 5441 } |
5440 | 5442 |
5441 Handle<String> name_; | 5443 Handle<String> name_; |
5442 TypeofMode typeof_mode_; | 5444 TypeofMode typeof_mode_; |
5443 Handle<TypeFeedbackVector> feedback_vector_; | 5445 Handle<TypeFeedbackVector> feedback_vector_; |
5444 FeedbackVectorICSlot slot_; | 5446 FeedbackVectorICSlot slot_; |
5445 }; | 5447 }; |
5446 | 5448 |
5447 | 5449 |
| 5450 class HLoadGlobalViaContext final : public HTemplateInstruction<1> { |
| 5451 public: |
| 5452 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalViaContext, |
| 5453 Handle<String>, int, int); |
| 5454 |
| 5455 HValue* context() { return OperandAt(0); } |
| 5456 Handle<String> name() const { return name_; } |
| 5457 int depth() const { return depth_; } |
| 5458 int slot_index() const { return slot_index_; } |
| 5459 |
| 5460 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
| 5461 |
| 5462 Representation RequiredInputRepresentation(int index) override { |
| 5463 return Representation::Tagged(); |
| 5464 } |
| 5465 |
| 5466 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalViaContext) |
| 5467 |
| 5468 private: |
| 5469 HLoadGlobalViaContext(HValue* context, Handle<String> name, int depth, |
| 5470 int slot_index) |
| 5471 : name_(name), depth_(depth), slot_index_(slot_index) { |
| 5472 SetOperandAt(0, context); |
| 5473 set_representation(Representation::Tagged()); |
| 5474 SetAllSideEffects(); |
| 5475 } |
| 5476 |
| 5477 Handle<String> name_; |
| 5478 int depth_; |
| 5479 int slot_index_; |
| 5480 }; |
| 5481 |
| 5482 |
5448 class HAllocate final : public HTemplateInstruction<2> { | 5483 class HAllocate final : public HTemplateInstruction<2> { |
5449 public: | 5484 public: |
5450 static bool CompatibleInstanceTypes(InstanceType type1, | 5485 static bool CompatibleInstanceTypes(InstanceType type1, |
5451 InstanceType type2) { | 5486 InstanceType type2) { |
5452 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && | 5487 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && |
5453 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); | 5488 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); |
5454 } | 5489 } |
5455 | 5490 |
5456 static HAllocate* New( | 5491 static HAllocate* New( |
5457 Isolate* isolate, Zone* zone, HValue* context, HValue* size, HType type, | 5492 Isolate* isolate, Zone* zone, HValue* context, HValue* size, HType type, |
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6972 } | 7007 } |
6973 | 7008 |
6974 Handle<Name> name_; | 7009 Handle<Name> name_; |
6975 Handle<TypeFeedbackVector> feedback_vector_; | 7010 Handle<TypeFeedbackVector> feedback_vector_; |
6976 FeedbackVectorICSlot slot_; | 7011 FeedbackVectorICSlot slot_; |
6977 LanguageMode language_mode_; | 7012 LanguageMode language_mode_; |
6978 InlineCacheState initialization_state_; | 7013 InlineCacheState initialization_state_; |
6979 }; | 7014 }; |
6980 | 7015 |
6981 | 7016 |
| 7017 class HStoreGlobalViaContext final : public HTemplateInstruction<2> { |
| 7018 public: |
| 7019 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(HStoreGlobalViaContext, |
| 7020 Handle<String>, HValue*, int, int, |
| 7021 LanguageMode); |
| 7022 HValue* context() const { return OperandAt(0); } |
| 7023 HValue* value() const { return OperandAt(1); } |
| 7024 Handle<String> name() const { return name_; } |
| 7025 int depth() const { return depth_; } |
| 7026 int slot_index() const { return slot_index_; } |
| 7027 LanguageMode language_mode() const { return language_mode_; } |
| 7028 |
| 7029 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
| 7030 |
| 7031 Representation RequiredInputRepresentation(int index) override { |
| 7032 return Representation::Tagged(); |
| 7033 } |
| 7034 |
| 7035 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalViaContext) |
| 7036 |
| 7037 private: |
| 7038 HStoreGlobalViaContext(HValue* context, Handle<String> name, HValue* value, |
| 7039 int depth, int slot_index, LanguageMode language_mode) |
| 7040 : name_(name), |
| 7041 depth_(depth), |
| 7042 slot_index_(slot_index), |
| 7043 language_mode_(language_mode) { |
| 7044 SetOperandAt(0, context); |
| 7045 SetOperandAt(1, value); |
| 7046 SetAllSideEffects(); |
| 7047 } |
| 7048 |
| 7049 Handle<String> name_; |
| 7050 int depth_; |
| 7051 int slot_index_; |
| 7052 LanguageMode language_mode_; |
| 7053 }; |
| 7054 |
| 7055 |
6982 class HStoreKeyed final : public HTemplateInstruction<3>, | 7056 class HStoreKeyed final : public HTemplateInstruction<3>, |
6983 public ArrayInstructionInterface { | 7057 public ArrayInstructionInterface { |
6984 public: | 7058 public: |
6985 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, | 7059 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, |
6986 ElementsKind); | 7060 ElementsKind); |
6987 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, | 7061 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, |
6988 ElementsKind, StoreFieldOrKeyedMode); | 7062 ElementsKind, StoreFieldOrKeyedMode); |
6989 DECLARE_INSTRUCTION_FACTORY_P6(HStoreKeyed, HValue*, HValue*, HValue*, | 7063 DECLARE_INSTRUCTION_FACTORY_P6(HStoreKeyed, HValue*, HValue*, HValue*, |
6990 ElementsKind, StoreFieldOrKeyedMode, int); | 7064 ElementsKind, StoreFieldOrKeyedMode, int); |
6991 | 7065 |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7968 }; | 8042 }; |
7969 | 8043 |
7970 | 8044 |
7971 | 8045 |
7972 #undef DECLARE_INSTRUCTION | 8046 #undef DECLARE_INSTRUCTION |
7973 #undef DECLARE_CONCRETE_INSTRUCTION | 8047 #undef DECLARE_CONCRETE_INSTRUCTION |
7974 | 8048 |
7975 } } // namespace v8::internal | 8049 } } // namespace v8::internal |
7976 | 8050 |
7977 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 8051 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |