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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 } | 332 } |
333 | 333 |
334 private: | 334 private: |
335 SetOncePointer<LEnvironment> environment_; | 335 SetOncePointer<LEnvironment> environment_; |
336 SetOncePointer<LPointerMap> pointer_map_; | 336 SetOncePointer<LPointerMap> pointer_map_; |
337 HValue* hydrogen_value_; | 337 HValue* hydrogen_value_; |
338 SetOncePointer<LEnvironment> deoptimization_environment_; | 338 SetOncePointer<LEnvironment> deoptimization_environment_; |
339 }; | 339 }; |
340 | 340 |
341 | 341 |
342 template<typename T, int N> | 342 template<typename ElementType, int NumElements> |
343 class OperandContainer { | 343 class OperandContainer { |
344 public: | 344 public: |
345 OperandContainer() { | 345 OperandContainer() { |
346 for (int i = 0; i < N; i++) elems_[i] = NULL; | 346 for (int i = 0; i < NumElements; i++) elems_[i] = NULL; |
347 } | 347 } |
348 int length() { return N; } | 348 int length() { return NumElements; } |
349 T& operator[](int i) { | 349 ElementType& operator[](int i) { |
350 ASSERT(i < length()); | 350 ASSERT(i < length()); |
351 return elems_[i]; | 351 return elems_[i]; |
352 } | 352 } |
353 void PrintOperandsTo(StringStream* stream); | 353 void PrintOperandsTo(StringStream* stream); |
354 | 354 |
355 private: | 355 private: |
356 T elems_[N]; | 356 ElementType elems_[NumElements]; |
357 }; | 357 }; |
358 | 358 |
359 | 359 |
360 template<typename T> | 360 template<typename ElementType> |
361 class OperandContainer<T, 0> { | 361 class OperandContainer<ElementType, 0> { |
362 public: | 362 public: |
363 int length() { return 0; } | 363 int length() { return 0; } |
364 void PrintOperandsTo(StringStream* stream) { } | 364 void PrintOperandsTo(StringStream* stream) { } |
365 }; | 365 }; |
366 | 366 |
367 | 367 |
| 368 // R = number of result operands (0 or 1). |
| 369 // I = number of input operands. |
| 370 // T = number of temporary operands. |
368 template<int R, int I, int T> | 371 template<int R, int I, int T> |
369 class LTemplateInstruction: public LInstruction { | 372 class LTemplateInstruction: public LInstruction { |
370 public: | 373 public: |
371 // Allow 0 or 1 output operands. | 374 // Allow 0 or 1 output operands. |
372 STATIC_ASSERT(R == 0 || R == 1); | 375 STATIC_ASSERT(R == 0 || R == 1); |
373 virtual bool HasResult() const { return R != 0; } | 376 virtual bool HasResult() const { return R != 0; } |
374 void set_result(LOperand* operand) { results_[0] = operand; } | 377 void set_result(LOperand* operand) { results_[0] = operand; } |
375 LOperand* result() { return results_[0]; } | 378 LOperand* result() { return results_[0]; } |
376 | 379 |
377 int InputCount() { return I; } | 380 int InputCount() { return I; } |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 explicit LNumberTagI(LOperand* value) { | 1432 explicit LNumberTagI(LOperand* value) { |
1430 inputs_[0] = value; | 1433 inputs_[0] = value; |
1431 } | 1434 } |
1432 | 1435 |
1433 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") | 1436 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") |
1434 }; | 1437 }; |
1435 | 1438 |
1436 | 1439 |
1437 class LNumberTagD: public LTemplateInstruction<1, 1, 1> { | 1440 class LNumberTagD: public LTemplateInstruction<1, 1, 1> { |
1438 public: | 1441 public: |
1439 explicit LNumberTagD(LOperand* value, LOperand* temp) { | 1442 LNumberTagD(LOperand* value, LOperand* temp) { |
1440 inputs_[0] = value; | 1443 inputs_[0] = value; |
1441 temps_[0] = temp; | 1444 temps_[0] = temp; |
1442 } | 1445 } |
1443 | 1446 |
1444 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") | 1447 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") |
1445 }; | 1448 }; |
1446 | 1449 |
1447 | 1450 |
1448 // Sometimes truncating conversion from a tagged value to an int32. | 1451 // Sometimes truncating conversion from a tagged value to an int32. |
1449 class LDoubleToI: public LTemplateInstruction<1, 1, 1> { | 1452 class LDoubleToI: public LTemplateInstruction<1, 1, 1> { |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2021 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2019 }; | 2022 }; |
2020 | 2023 |
2021 #undef DECLARE_HYDROGEN_ACCESSOR | 2024 #undef DECLARE_HYDROGEN_ACCESSOR |
2022 #undef DECLARE_INSTRUCTION | 2025 #undef DECLARE_INSTRUCTION |
2023 #undef DECLARE_CONCRETE_INSTRUCTION | 2026 #undef DECLARE_CONCRETE_INSTRUCTION |
2024 | 2027 |
2025 } } // namespace v8::internal | 2028 } } // namespace v8::internal |
2026 | 2029 |
2027 #endif // V8_IA32_LITHIUM_IA32_H_ | 2030 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |