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 support. |
| 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 }; | 279 }; |
277 | 280 |
278 | 281 |
279 // R = number of result operands (0 or 1). | 282 // R = number of result operands (0 or 1). |
280 // I = number of input operands. | 283 // I = number of input operands. |
281 // T = number of temporary operands. | 284 // T = number of temporary operands. |
282 template<int R, int I, int T> | 285 template<int R, int I, int T> |
283 class LTemplateInstruction: public LInstruction { | 286 class LTemplateInstruction: public LInstruction { |
284 public: | 287 public: |
285 // Allow 0 or 1 output operands. | 288 // Allow 0 or 1 output operands. |
286 STATIC_ASSERT(R == 0 || R == 1); | 289 STATIC_ASSERT(R == 0 || R == 1); |
287 virtual bool HasResult() const { return R != 0; } | 290 virtual bool HasResult() const { return R != 0; } |
288 void set_result(LOperand* operand) { results_[0] = operand; } | 291 void set_result(LOperand* operand) { results_[0] = operand; } |
289 LOperand* result() { return results_[0]; } | 292 LOperand* result() { return results_[0]; } |
290 | 293 |
291 int InputCount() { return I; } | |
292 LOperand* InputAt(int i) { return inputs_[i]; } | 294 LOperand* InputAt(int i) { return inputs_[i]; } |
293 | 295 |
294 int TempCount() { return T; } | 296 int TempCount() { return T; } |
295 LOperand* TempAt(int i) { return temps_[i]; } | 297 LOperand* TempAt(int i) { return temps_[i]; } |
296 | 298 |
297 protected: | 299 protected: |
298 EmbeddedContainer<LOperand*, R> results_; | 300 EmbeddedContainer<LOperand*, R> results_; |
299 EmbeddedContainer<LOperand*, I> inputs_; | 301 EmbeddedContainer<LOperand*, I> inputs_; |
300 EmbeddedContainer<LOperand*, T> temps_; | 302 EmbeddedContainer<LOperand*, T> temps_; |
| 303 |
| 304 private: |
| 305 virtual int InputCount() { return I; } |
301 }; | 306 }; |
302 | 307 |
303 | 308 |
304 class LGap: public LTemplateInstruction<0, 0, 0> { | 309 class LGap: public LTemplateInstruction<0, 0, 0> { |
305 public: | 310 public: |
306 explicit LGap(HBasicBlock* block) : block_(block) { | 311 explicit LGap(HBasicBlock* block) : block_(block) { |
307 parallel_moves_[BEFORE] = NULL; | 312 parallel_moves_[BEFORE] = NULL; |
308 parallel_moves_[START] = NULL; | 313 parallel_moves_[START] = NULL; |
309 parallel_moves_[END] = NULL; | 314 parallel_moves_[END] = NULL; |
310 parallel_moves_[AFTER] = NULL; | 315 parallel_moves_[AFTER] = NULL; |
(...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2542 | 2547 |
2543 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2548 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2544 }; | 2549 }; |
2545 | 2550 |
2546 #undef DECLARE_HYDROGEN_ACCESSOR | 2551 #undef DECLARE_HYDROGEN_ACCESSOR |
2547 #undef DECLARE_CONCRETE_INSTRUCTION | 2552 #undef DECLARE_CONCRETE_INSTRUCTION |
2548 | 2553 |
2549 } } // namespace v8::internal | 2554 } } // namespace v8::internal |
2550 | 2555 |
2551 #endif // V8_IA32_LITHIUM_IA32_H_ | 2556 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |