| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 328 } |
| 329 | 329 |
| 330 private: | 330 private: |
| 331 SetOncePointer<LEnvironment> environment_; | 331 SetOncePointer<LEnvironment> environment_; |
| 332 SetOncePointer<LPointerMap> pointer_map_; | 332 SetOncePointer<LPointerMap> pointer_map_; |
| 333 HValue* hydrogen_value_; | 333 HValue* hydrogen_value_; |
| 334 SetOncePointer<LEnvironment> deoptimization_environment_; | 334 SetOncePointer<LEnvironment> deoptimization_environment_; |
| 335 }; | 335 }; |
| 336 | 336 |
| 337 | 337 |
| 338 template<typename T, int N> | 338 template<typename ElementType, int NumElements> |
| 339 class OperandContainer { | 339 class OperandContainer { |
| 340 public: | 340 public: |
| 341 OperandContainer() { | 341 OperandContainer() { |
| 342 for (int i = 0; i < N; i++) elems_[i] = NULL; | 342 for (int i = 0; i < NumElements; i++) elems_[i] = NULL; |
| 343 } | 343 } |
| 344 int length() { return N; } | 344 int length() { return NumElements; } |
| 345 T& operator[](int i) { | 345 ElementType& operator[](int i) { |
| 346 ASSERT(i < length()); | 346 ASSERT(i < length()); |
| 347 return elems_[i]; | 347 return elems_[i]; |
| 348 } | 348 } |
| 349 void PrintOperandsTo(StringStream* stream); | 349 void PrintOperandsTo(StringStream* stream); |
| 350 | 350 |
| 351 private: | 351 private: |
| 352 T elems_[N]; | 352 ElementType elems_[NumElements]; |
| 353 }; | 353 }; |
| 354 | 354 |
| 355 | 355 |
| 356 template<typename T> | 356 template<typename ElementType> |
| 357 class OperandContainer<T, 0> { | 357 class OperandContainer<ElementType, 0> { |
| 358 public: | 358 public: |
| 359 int length() { return 0; } | 359 int length() { return 0; } |
| 360 void PrintOperandsTo(StringStream* stream) { } | 360 void PrintOperandsTo(StringStream* stream) { } |
| 361 }; | 361 }; |
| 362 | 362 |
| 363 | 363 |
| 364 // R = number of result operands (0 or 1). |
| 365 // I = number of input operands. |
| 366 // T = number of temporary operands. |
| 364 template<int R, int I, int T> | 367 template<int R, int I, int T> |
| 365 class LTemplateInstruction: public LInstruction { | 368 class LTemplateInstruction: public LInstruction { |
| 366 public: | 369 public: |
| 367 // Allow 0 or 1 output operands. | 370 // Allow 0 or 1 output operands. |
| 368 STATIC_ASSERT(R == 0 || R == 1); | 371 STATIC_ASSERT(R == 0 || R == 1); |
| 369 virtual bool HasResult() const { return R != 0; } | 372 virtual bool HasResult() const { return R != 0; } |
| 370 void set_result(LOperand* operand) { results_[0] = operand; } | 373 void set_result(LOperand* operand) { results_[0] = operand; } |
| 371 LOperand* result() { return results_[0]; } | 374 LOperand* result() { return results_[0]; } |
| 372 | 375 |
| 373 int InputCount() { return I; } | 376 int InputCount() { return I; } |
| (...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1987 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 1990 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 1988 }; | 1991 }; |
| 1989 | 1992 |
| 1990 #undef DECLARE_HYDROGEN_ACCESSOR | 1993 #undef DECLARE_HYDROGEN_ACCESSOR |
| 1991 #undef DECLARE_INSTRUCTION | 1994 #undef DECLARE_INSTRUCTION |
| 1992 #undef DECLARE_CONCRETE_INSTRUCTION | 1995 #undef DECLARE_CONCRETE_INSTRUCTION |
| 1993 | 1996 |
| 1994 } } // namespace v8::int | 1997 } } // namespace v8::int |
| 1995 | 1998 |
| 1996 #endif // V8_X64_LITHIUM_X64_H_ | 1999 #endif // V8_X64_LITHIUM_X64_H_ |
| OLD | NEW |