OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 V(CheckSmi) \ | 72 V(CheckSmi) \ |
73 V(ClampDToUint8) \ | 73 V(ClampDToUint8) \ |
74 V(ClampIToUint8) \ | 74 V(ClampIToUint8) \ |
75 V(ClampTToUint8) \ | 75 V(ClampTToUint8) \ |
76 V(ClassOfTestAndBranch) \ | 76 V(ClassOfTestAndBranch) \ |
77 V(CompareNumericAndBranch) \ | 77 V(CompareNumericAndBranch) \ |
78 V(CmpObjectEqAndBranch) \ | 78 V(CmpObjectEqAndBranch) \ |
79 V(CmpMapAndBranch) \ | 79 V(CmpMapAndBranch) \ |
80 V(CmpT) \ | 80 V(CmpT) \ |
81 V(ConstantD) \ | 81 V(ConstantD) \ |
82 V(ConstantE) \ | |
83 V(ConstantI) \ | 82 V(ConstantI) \ |
84 V(ConstantS) \ | 83 V(ConstantS) \ |
85 V(ConstantT) \ | 84 V(ConstantT) \ |
86 V(Context) \ | 85 V(Context) \ |
87 V(DateField) \ | 86 V(DateField) \ |
88 V(DebugBreak) \ | 87 V(DebugBreak) \ |
89 V(DeclareGlobals) \ | 88 V(DeclareGlobals) \ |
90 V(Deoptimize) \ | 89 V(Deoptimize) \ |
91 V(DivI) \ | 90 V(DivI) \ |
92 V(DoubleToI) \ | 91 V(DoubleToI) \ |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 261 |
263 // Interface to the register allocator and iterators. | 262 // Interface to the register allocator and iterators. |
264 bool ClobbersTemps() const { return is_call_; } | 263 bool ClobbersTemps() const { return is_call_; } |
265 bool ClobbersRegisters() const { return is_call_; } | 264 bool ClobbersRegisters() const { return is_call_; } |
266 bool ClobbersDoubleRegisters() const { return is_call_; } | 265 bool ClobbersDoubleRegisters() const { return is_call_; } |
267 | 266 |
268 // Interface to the register allocator and iterators. | 267 // Interface to the register allocator and iterators. |
269 bool IsMarkedAsCall() const { return is_call_; } | 268 bool IsMarkedAsCall() const { return is_call_; } |
270 | 269 |
271 virtual bool HasResult() const = 0; | 270 virtual bool HasResult() const = 0; |
272 virtual LOperand* result() const = 0; | 271 virtual LOperand* result() = 0; |
273 | 272 |
274 LOperand* FirstInput() { return InputAt(0); } | 273 LOperand* FirstInput() { return InputAt(0); } |
275 LOperand* Output() { return HasResult() ? result() : NULL; } | 274 LOperand* Output() { return HasResult() ? result() : NULL; } |
276 | 275 |
277 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } | 276 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
278 | 277 |
279 #ifdef DEBUG | 278 #ifdef DEBUG |
280 void VerifyCall(); | 279 void VerifyCall(); |
281 #endif | 280 #endif |
282 | 281 |
(...skipping 15 matching lines...) Expand all Loading... |
298 | 297 |
299 | 298 |
300 // R = number of result operands (0 or 1). | 299 // R = number of result operands (0 or 1). |
301 // I = number of input operands. | 300 // I = number of input operands. |
302 // T = number of temporary operands. | 301 // T = number of temporary operands. |
303 template<int R, int I, int T> | 302 template<int R, int I, int T> |
304 class LTemplateInstruction: public LInstruction { | 303 class LTemplateInstruction: public LInstruction { |
305 public: | 304 public: |
306 // Allow 0 or 1 output operands. | 305 // Allow 0 or 1 output operands. |
307 STATIC_ASSERT(R == 0 || R == 1); | 306 STATIC_ASSERT(R == 0 || R == 1); |
308 virtual bool HasResult() const { return R != 0 && result() != NULL; } | 307 virtual bool HasResult() const { return R != 0; } |
309 void set_result(LOperand* operand) { results_[0] = operand; } | 308 void set_result(LOperand* operand) { results_[0] = operand; } |
310 LOperand* result() const { return results_[0]; } | 309 LOperand* result() { return results_[0]; } |
311 | 310 |
312 protected: | 311 protected: |
313 EmbeddedContainer<LOperand*, R> results_; | 312 EmbeddedContainer<LOperand*, R> results_; |
314 EmbeddedContainer<LOperand*, I> inputs_; | 313 EmbeddedContainer<LOperand*, I> inputs_; |
315 EmbeddedContainer<LOperand*, T> temps_; | 314 EmbeddedContainer<LOperand*, T> temps_; |
316 | 315 |
317 private: | 316 private: |
318 virtual int InputCount() { return I; } | 317 virtual int InputCount() { return I; } |
319 virtual LOperand* InputAt(int i) { return inputs_[i]; } | 318 virtual LOperand* InputAt(int i) { return inputs_[i]; } |
320 | 319 |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 | 1225 |
1227 class LConstantD: public LTemplateInstruction<1, 0, 0> { | 1226 class LConstantD: public LTemplateInstruction<1, 0, 0> { |
1228 public: | 1227 public: |
1229 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") | 1228 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") |
1230 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1229 DECLARE_HYDROGEN_ACCESSOR(Constant) |
1231 | 1230 |
1232 double value() const { return hydrogen()->DoubleValue(); } | 1231 double value() const { return hydrogen()->DoubleValue(); } |
1233 }; | 1232 }; |
1234 | 1233 |
1235 | 1234 |
1236 class LConstantE: public LTemplateInstruction<1, 0, 0> { | |
1237 public: | |
1238 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") | |
1239 DECLARE_HYDROGEN_ACCESSOR(Constant) | |
1240 | |
1241 ExternalReference value() const { | |
1242 return hydrogen()->ExternalReferenceValue(); | |
1243 } | |
1244 }; | |
1245 | |
1246 | |
1247 class LConstantT: public LTemplateInstruction<1, 0, 0> { | 1235 class LConstantT: public LTemplateInstruction<1, 0, 0> { |
1248 public: | 1236 public: |
1249 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | 1237 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") |
1250 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1238 DECLARE_HYDROGEN_ACCESSOR(Constant) |
1251 | 1239 |
1252 Handle<Object> value() const { return hydrogen()->handle(); } | 1240 Handle<Object> value() const { return hydrogen()->handle(); } |
1253 }; | 1241 }; |
1254 | 1242 |
1255 | 1243 |
1256 class LBranch: public LControlInstruction<1, 0> { | 1244 class LBranch: public LControlInstruction<1, 0> { |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2241 | 2229 |
2242 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") | 2230 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") |
2243 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) | 2231 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) |
2244 | 2232 |
2245 virtual void PrintDataTo(StringStream* stream); | 2233 virtual void PrintDataTo(StringStream* stream); |
2246 | 2234 |
2247 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } | 2235 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } |
2248 }; | 2236 }; |
2249 | 2237 |
2250 | 2238 |
2251 class LTransitionElementsKind: public LTemplateInstruction<0, 1, 1> { | 2239 class LTransitionElementsKind: public LTemplateInstruction<0, 1, 2> { |
2252 public: | 2240 public: |
2253 LTransitionElementsKind(LOperand* object, | 2241 LTransitionElementsKind(LOperand* object, |
2254 LOperand* new_map_temp) { | 2242 LOperand* new_map_temp, |
| 2243 LOperand* fixed_object_temp) { |
2255 inputs_[0] = object; | 2244 inputs_[0] = object; |
2256 temps_[0] = new_map_temp; | 2245 temps_[0] = new_map_temp; |
| 2246 temps_[1] = fixed_object_temp; |
2257 } | 2247 } |
2258 | 2248 |
2259 LOperand* object() { return inputs_[0]; } | 2249 LOperand* object() { return inputs_[0]; } |
2260 LOperand* new_map_temp() { return temps_[0]; } | 2250 LOperand* new_map_temp() { return temps_[0]; } |
| 2251 LOperand* temp() { return temps_[1]; } |
2261 | 2252 |
2262 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, | 2253 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, |
2263 "transition-elements-kind") | 2254 "transition-elements-kind") |
2264 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) | 2255 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) |
2265 | 2256 |
2266 virtual void PrintDataTo(StringStream* stream); | 2257 virtual void PrintDataTo(StringStream* stream); |
2267 | 2258 |
2268 Handle<Map> original_map() { return hydrogen()->original_map(); } | 2259 Handle<Map> original_map() { return hydrogen()->original_map(); } |
2269 Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); } | 2260 Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); } |
2270 ElementsKind from_kind() { return hydrogen()->from_kind(); } | 2261 ElementsKind from_kind() { return hydrogen()->from_kind(); } |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2811 | 2802 |
2812 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2803 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2813 }; | 2804 }; |
2814 | 2805 |
2815 #undef DECLARE_HYDROGEN_ACCESSOR | 2806 #undef DECLARE_HYDROGEN_ACCESSOR |
2816 #undef DECLARE_CONCRETE_INSTRUCTION | 2807 #undef DECLARE_CONCRETE_INSTRUCTION |
2817 | 2808 |
2818 } } // namespace v8::internal | 2809 } } // namespace v8::internal |
2819 | 2810 |
2820 #endif // V8_ARM_LITHIUM_ARM_H_ | 2811 #endif // V8_ARM_LITHIUM_ARM_H_ |
OLD | NEW |