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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 // Interface to the register allocator and iterators. | 259 // Interface to the register allocator and iterators. |
260 bool ClobbersTemps() const { return is_call_; } | 260 bool ClobbersTemps() const { return is_call_; } |
261 bool ClobbersRegisters() const { return is_call_; } | 261 bool ClobbersRegisters() const { return is_call_; } |
262 bool ClobbersDoubleRegisters() const { return is_call_; } | 262 bool ClobbersDoubleRegisters() const { return is_call_; } |
263 | 263 |
264 // Interface to the register allocator and iterators. | 264 // Interface to the register allocator and iterators. |
265 bool IsMarkedAsCall() const { return is_call_; } | 265 bool IsMarkedAsCall() const { return is_call_; } |
266 | 266 |
267 virtual bool HasResult() const = 0; | 267 virtual bool HasResult() const = 0; |
268 virtual LOperand* result() = 0; | 268 virtual LOperand* result() const = 0; |
269 | 269 |
270 LOperand* FirstInput() { return InputAt(0); } | 270 LOperand* FirstInput() { return InputAt(0); } |
271 LOperand* Output() { return HasResult() ? result() : NULL; } | 271 LOperand* Output() { return HasResult() ? result() : NULL; } |
272 | 272 |
273 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } | 273 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
274 | 274 |
275 #ifdef DEBUG | 275 #ifdef DEBUG |
276 void VerifyCall(); | 276 void VerifyCall(); |
277 #endif | 277 #endif |
278 | 278 |
(...skipping 15 matching lines...) Expand all Loading... |
294 | 294 |
295 | 295 |
296 // R = number of result operands (0 or 1). | 296 // R = number of result operands (0 or 1). |
297 // I = number of input operands. | 297 // I = number of input operands. |
298 // T = number of temporary operands. | 298 // T = number of temporary operands. |
299 template<int R, int I, int T> | 299 template<int R, int I, int T> |
300 class LTemplateInstruction: public LInstruction { | 300 class LTemplateInstruction: public LInstruction { |
301 public: | 301 public: |
302 // Allow 0 or 1 output operands. | 302 // Allow 0 or 1 output operands. |
303 STATIC_ASSERT(R == 0 || R == 1); | 303 STATIC_ASSERT(R == 0 || R == 1); |
304 virtual bool HasResult() const { return R != 0; } | 304 virtual bool HasResult() const { return R != 0 && result() != NULL; } |
305 void set_result(LOperand* operand) { results_[0] = operand; } | 305 void set_result(LOperand* operand) { results_[0] = operand; } |
306 LOperand* result() { return results_[0]; } | 306 LOperand* result() const { return results_[0]; } |
307 | 307 |
308 protected: | 308 protected: |
309 EmbeddedContainer<LOperand*, R> results_; | 309 EmbeddedContainer<LOperand*, R> results_; |
310 EmbeddedContainer<LOperand*, I> inputs_; | 310 EmbeddedContainer<LOperand*, I> inputs_; |
311 EmbeddedContainer<LOperand*, T> temps_; | 311 EmbeddedContainer<LOperand*, T> temps_; |
312 | 312 |
313 private: | 313 private: |
314 virtual int InputCount() { return I; } | 314 virtual int InputCount() { return I; } |
315 virtual LOperand* InputAt(int i) { return inputs_[i]; } | 315 virtual LOperand* InputAt(int i) { return inputs_[i]; } |
316 | 316 |
(...skipping 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 | 2772 |
2773 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2773 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2774 }; | 2774 }; |
2775 | 2775 |
2776 #undef DECLARE_HYDROGEN_ACCESSOR | 2776 #undef DECLARE_HYDROGEN_ACCESSOR |
2777 #undef DECLARE_CONCRETE_INSTRUCTION | 2777 #undef DECLARE_CONCRETE_INSTRUCTION |
2778 | 2778 |
2779 } } // namespace v8::internal | 2779 } } // namespace v8::internal |
2780 | 2780 |
2781 #endif // V8_MIPS_LITHIUM_MIPS_H_ | 2781 #endif // V8_MIPS_LITHIUM_MIPS_H_ |
OLD | NEW |