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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 249 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
250 | 250 |
251 void MarkAsCall() { is_call_ = true; } | 251 void MarkAsCall() { is_call_ = true; } |
252 | 252 |
253 // Interface to the register allocator and iterators. | 253 // Interface to the register allocator and iterators. |
254 bool IsMarkedAsCall() const { return is_call_; } | 254 bool IsMarkedAsCall() const { return is_call_; } |
255 | 255 |
256 virtual bool HasResult() const = 0; | 256 virtual bool HasResult() const = 0; |
257 virtual LOperand* result() = 0; | 257 virtual LOperand* result() = 0; |
258 | 258 |
259 virtual int InputCount() = 0; | |
260 virtual LOperand* InputAt(int i) = 0; | |
261 virtual int TempCount() = 0; | 259 virtual int TempCount() = 0; |
262 virtual LOperand* TempAt(int i) = 0; | 260 virtual LOperand* TempAt(int i) = 0; |
263 | 261 |
264 LOperand* FirstInput() { return InputAt(0); } | 262 LOperand* FirstInput() { return InputAt(0); } |
265 LOperand* Output() { return HasResult() ? result() : NULL; } | 263 LOperand* Output() { return HasResult() ? result() : NULL; } |
266 | 264 |
267 #ifdef DEBUG | 265 #ifdef DEBUG |
268 void VerifyCall(); | 266 void VerifyCall(); |
269 #endif | 267 #endif |
270 | 268 |
271 private: | 269 private: |
| 270 // Iterator interface. |
| 271 friend class InputIterator; |
| 272 virtual int InputCount() = 0; |
| 273 virtual LOperand* InputAt(int i) = 0; |
| 274 |
272 LEnvironment* environment_; | 275 LEnvironment* environment_; |
273 SetOncePointer<LPointerMap> pointer_map_; | 276 SetOncePointer<LPointerMap> pointer_map_; |
274 HValue* hydrogen_value_; | 277 HValue* hydrogen_value_; |
275 bool is_call_; | 278 bool is_call_; |
276 bool is_save_doubles_; | 279 bool is_save_doubles_; |
277 }; | 280 }; |
278 | 281 |
279 | 282 |
280 // R = number of result operands (0 or 1). | 283 // R = number of result operands (0 or 1). |
281 // I = number of input operands. | 284 // I = number of input operands. |
282 // T = number of temporary operands. | 285 // T = number of temporary operands. |
283 template<int R, int I, int T> | 286 template<int R, int I, int T> |
284 class LTemplateInstruction: public LInstruction { | 287 class LTemplateInstruction: public LInstruction { |
285 public: | 288 public: |
286 // Allow 0 or 1 output operands. | 289 // Allow 0 or 1 output operands. |
287 STATIC_ASSERT(R == 0 || R == 1); | 290 STATIC_ASSERT(R == 0 || R == 1); |
288 virtual bool HasResult() const { return R != 0; } | 291 virtual bool HasResult() const { return R != 0; } |
289 void set_result(LOperand* operand) { results_[0] = operand; } | 292 void set_result(LOperand* operand) { results_[0] = operand; } |
290 LOperand* result() { return results_[0]; } | 293 LOperand* result() { return results_[0]; } |
291 | 294 |
292 int InputCount() { return I; } | |
293 LOperand* InputAt(int i) { return inputs_[i]; } | 295 LOperand* InputAt(int i) { return inputs_[i]; } |
294 | 296 |
295 int TempCount() { return T; } | 297 int TempCount() { return T; } |
296 LOperand* TempAt(int i) { return temps_[i]; } | 298 LOperand* TempAt(int i) { return temps_[i]; } |
297 | 299 |
298 protected: | 300 protected: |
299 EmbeddedContainer<LOperand*, R> results_; | 301 EmbeddedContainer<LOperand*, R> results_; |
300 EmbeddedContainer<LOperand*, I> inputs_; | 302 EmbeddedContainer<LOperand*, I> inputs_; |
301 EmbeddedContainer<LOperand*, T> temps_; | 303 EmbeddedContainer<LOperand*, T> temps_; |
| 304 |
| 305 private: |
| 306 virtual int InputCount() { return I; } |
302 }; | 307 }; |
303 | 308 |
304 | 309 |
305 class LGap: public LTemplateInstruction<0, 0, 0> { | 310 class LGap: public LTemplateInstruction<0, 0, 0> { |
306 public: | 311 public: |
307 explicit LGap(HBasicBlock* block) | 312 explicit LGap(HBasicBlock* block) |
308 : block_(block) { | 313 : block_(block) { |
309 parallel_moves_[BEFORE] = NULL; | 314 parallel_moves_[BEFORE] = NULL; |
310 parallel_moves_[START] = NULL; | 315 parallel_moves_[START] = NULL; |
311 parallel_moves_[END] = NULL; | 316 parallel_moves_[END] = NULL; |
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2364 | 2369 |
2365 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2370 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2366 }; | 2371 }; |
2367 | 2372 |
2368 #undef DECLARE_HYDROGEN_ACCESSOR | 2373 #undef DECLARE_HYDROGEN_ACCESSOR |
2369 #undef DECLARE_CONCRETE_INSTRUCTION | 2374 #undef DECLARE_CONCRETE_INSTRUCTION |
2370 | 2375 |
2371 } } // namespace v8::internal | 2376 } } // namespace v8::internal |
2372 | 2377 |
2373 #endif // V8_MIPS_LITHIUM_MIPS_H_ | 2378 #endif // V8_MIPS_LITHIUM_MIPS_H_ |
OLD | NEW |