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 "v8.h" | 8 #include "v8.h" |
9 | 9 |
10 #include "allocation.h" | 10 #include "allocation.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 V(LoadNamedGeneric) \ | 120 V(LoadNamedGeneric) \ |
121 V(LoadRoot) \ | 121 V(LoadRoot) \ |
122 V(MapEnumLength) \ | 122 V(MapEnumLength) \ |
123 V(MathFloorOfDiv) \ | 123 V(MathFloorOfDiv) \ |
124 V(MathMinMax) \ | 124 V(MathMinMax) \ |
125 V(Mod) \ | 125 V(Mod) \ |
126 V(Mul) \ | 126 V(Mul) \ |
127 V(OsrEntry) \ | 127 V(OsrEntry) \ |
128 V(Parameter) \ | 128 V(Parameter) \ |
129 V(Power) \ | 129 V(Power) \ |
130 V(PushArgument) \ | 130 V(PushArguments) \ |
131 V(RegExpLiteral) \ | 131 V(RegExpLiteral) \ |
132 V(Return) \ | 132 V(Return) \ |
133 V(Ror) \ | 133 V(Ror) \ |
134 V(Sar) \ | 134 V(Sar) \ |
135 V(SeqStringGetChar) \ | 135 V(SeqStringGetChar) \ |
136 V(SeqStringSetChar) \ | 136 V(SeqStringSetChar) \ |
137 V(Shl) \ | 137 V(Shl) \ |
138 V(Shr) \ | 138 V(Shr) \ |
139 V(Simulate) \ | 139 V(Simulate) \ |
140 V(StackCheck) \ | 140 V(StackCheck) \ |
(...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2168 } | 2168 } |
2169 | 2169 |
2170 DECLARE_CONCRETE_INSTRUCTION(LeaveInlined) | 2170 DECLARE_CONCRETE_INSTRUCTION(LeaveInlined) |
2171 | 2171 |
2172 private: | 2172 private: |
2173 HEnterInlined* entry_; | 2173 HEnterInlined* entry_; |
2174 int drop_count_; | 2174 int drop_count_; |
2175 }; | 2175 }; |
2176 | 2176 |
2177 | 2177 |
2178 class HPushArgument V8_FINAL : public HUnaryOperation { | 2178 class HPushArguments V8_FINAL : public HInstruction { |
2179 public: | 2179 public: |
2180 DECLARE_INSTRUCTION_FACTORY_P1(HPushArgument, HValue*); | 2180 DECLARE_INSTRUCTION_FACTORY_P1(HPushArguments, Zone*); |
| 2181 DECLARE_INSTRUCTION_FACTORY_P2(HPushArguments, Zone*, HValue*); |
| 2182 DECLARE_INSTRUCTION_FACTORY_P3(HPushArguments, Zone*, HValue*, HValue*); |
| 2183 DECLARE_INSTRUCTION_FACTORY_P4(HPushArguments, Zone*, |
| 2184 HValue*, HValue*, HValue*); |
| 2185 DECLARE_INSTRUCTION_FACTORY_P5(HPushArguments, Zone*, |
| 2186 HValue*, HValue*, HValue*, HValue*); |
2181 | 2187 |
2182 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 2188 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
2183 return Representation::Tagged(); | 2189 return Representation::Tagged(); |
2184 } | 2190 } |
2185 | 2191 |
2186 virtual int argument_delta() const V8_OVERRIDE { return 1; } | 2192 virtual int argument_delta() const V8_OVERRIDE { return inputs_.length(); } |
2187 HValue* argument() { return OperandAt(0); } | 2193 HValue* argument(int i) { return OperandAt(i); } |
2188 | 2194 |
2189 DECLARE_CONCRETE_INSTRUCTION(PushArgument) | 2195 virtual int OperandCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); } |
| 2196 virtual HValue* OperandAt(int i) const V8_FINAL V8_OVERRIDE { |
| 2197 return inputs_[i]; |
| 2198 } |
| 2199 |
| 2200 void AddArgument(HValue* arg) { |
| 2201 inputs_.Add(NULL, zone_); |
| 2202 SetOperandAt(inputs_.length() - 1, arg); |
| 2203 } |
| 2204 |
| 2205 DECLARE_CONCRETE_INSTRUCTION(PushArguments) |
| 2206 |
| 2207 protected: |
| 2208 virtual void InternalSetOperandAt(int i, HValue* value) V8_FINAL V8_OVERRIDE { |
| 2209 inputs_[i] = value; |
| 2210 } |
2190 | 2211 |
2191 private: | 2212 private: |
2192 explicit HPushArgument(HValue* value) : HUnaryOperation(value) { | 2213 HPushArguments(Zone* zone, |
| 2214 HValue* arg1 = NULL, HValue* arg2 = NULL, |
| 2215 HValue* arg3 = NULL, HValue* arg4 = NULL) |
| 2216 : HInstruction(HType::Tagged()), zone_(zone), inputs_(4, zone) { |
2193 set_representation(Representation::Tagged()); | 2217 set_representation(Representation::Tagged()); |
| 2218 if (arg1) { |
| 2219 inputs_.Add(NULL, zone); |
| 2220 SetOperandAt(0, arg1); |
| 2221 } |
| 2222 if (arg2) { |
| 2223 inputs_.Add(NULL, zone); |
| 2224 SetOperandAt(1, arg2); |
| 2225 } |
| 2226 if (arg3) { |
| 2227 inputs_.Add(NULL, zone); |
| 2228 SetOperandAt(2, arg3); |
| 2229 } |
| 2230 if (arg4) { |
| 2231 inputs_.Add(NULL, zone); |
| 2232 SetOperandAt(3, arg4); |
| 2233 } |
2194 } | 2234 } |
| 2235 |
| 2236 Zone* zone_; |
| 2237 ZoneList<HValue*> inputs_; |
2195 }; | 2238 }; |
2196 | 2239 |
2197 | 2240 |
2198 class HThisFunction V8_FINAL : public HTemplateInstruction<0> { | 2241 class HThisFunction V8_FINAL : public HTemplateInstruction<0> { |
2199 public: | 2242 public: |
2200 DECLARE_INSTRUCTION_FACTORY_P0(HThisFunction); | 2243 DECLARE_INSTRUCTION_FACTORY_P0(HThisFunction); |
2201 | 2244 |
2202 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 2245 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
2203 return Representation::None(); | 2246 return Representation::None(); |
2204 } | 2247 } |
(...skipping 5550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7755 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7798 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7756 }; | 7799 }; |
7757 | 7800 |
7758 | 7801 |
7759 #undef DECLARE_INSTRUCTION | 7802 #undef DECLARE_INSTRUCTION |
7760 #undef DECLARE_CONCRETE_INSTRUCTION | 7803 #undef DECLARE_CONCRETE_INSTRUCTION |
7761 | 7804 |
7762 } } // namespace v8::internal | 7805 } } // namespace v8::internal |
7763 | 7806 |
7764 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7807 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |