| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Code relies on kStep being a power of two. | 139 // Code relies on kStep being a power of two. |
| 140 STATIC_ASSERT(IS_POWER_OF_TWO(kStep)); | 140 STATIC_ASSERT(IS_POWER_OF_TWO(kStep)); |
| 141 | 141 |
| 142 explicit LifetimePosition(int value) : value_(value) { } | 142 explicit LifetimePosition(int value) : value_(value) { } |
| 143 | 143 |
| 144 int value_; | 144 int value_; |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 | 147 |
| 148 enum RegisterKind { | 148 enum RegisterKind { |
| 149 NONE, | |
| 150 GENERAL_REGISTERS, | 149 GENERAL_REGISTERS, |
| 151 DOUBLE_REGISTERS | 150 DOUBLE_REGISTERS |
| 152 }; | 151 }; |
| 153 | 152 |
| 154 | 153 |
| 155 // A register-allocator view of a Lithium instruction. It contains the id of | 154 // A register-allocator view of a Lithium instruction. It contains the id of |
| 156 // the output operand and a list of input operand uses. | 155 // the output operand and a list of input operand uses. |
| 157 | 156 |
| 158 class LInstruction; | 157 class LInstruction; |
| 159 class LEnvironment; | 158 class LEnvironment; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 311 |
| 313 // Can this live range be spilled at this position. | 312 // Can this live range be spilled at this position. |
| 314 bool CanBeSpilled(LifetimePosition pos); | 313 bool CanBeSpilled(LifetimePosition pos); |
| 315 | 314 |
| 316 // Split this live range at the given position which must follow the start of | 315 // Split this live range at the given position which must follow the start of |
| 317 // the range. | 316 // the range. |
| 318 // All uses following the given position will be moved from this | 317 // All uses following the given position will be moved from this |
| 319 // live range to the result live range. | 318 // live range to the result live range. |
| 320 void SplitAt(LifetimePosition position, LiveRange* result); | 319 void SplitAt(LifetimePosition position, LiveRange* result); |
| 321 | 320 |
| 322 bool IsDouble() const { return assigned_register_kind_ == DOUBLE_REGISTERS; } | 321 bool IsDouble() const { return is_double_; } |
| 323 bool HasRegisterAssigned() const { | 322 bool HasRegisterAssigned() const { |
| 324 return assigned_register_ != kInvalidAssignment; | 323 return assigned_register_ != kInvalidAssignment; |
| 325 } | 324 } |
| 326 bool IsSpilled() const { return spilled_; } | 325 bool IsSpilled() const { return spilled_; } |
| 327 UsePosition* FirstPosWithHint() const; | 326 UsePosition* FirstPosWithHint() const; |
| 328 | 327 |
| 329 LOperand* FirstHint() const { | 328 LOperand* FirstHint() const { |
| 330 UsePosition* pos = FirstPosWithHint(); | 329 UsePosition* pos = FirstPosWithHint(); |
| 331 if (pos != NULL) return pos->hint(); | 330 if (pos != NULL) return pos->hint(); |
| 332 return NULL; | 331 return NULL; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 #endif | 369 #endif |
| 371 | 370 |
| 372 private: | 371 private: |
| 373 void ConvertOperands(); | 372 void ConvertOperands(); |
| 374 UseInterval* FirstSearchIntervalForPosition(LifetimePosition position) const; | 373 UseInterval* FirstSearchIntervalForPosition(LifetimePosition position) const; |
| 375 void AdvanceLastProcessedMarker(UseInterval* to_start_of, | 374 void AdvanceLastProcessedMarker(UseInterval* to_start_of, |
| 376 LifetimePosition but_not_past) const; | 375 LifetimePosition but_not_past) const; |
| 377 | 376 |
| 378 int id_; | 377 int id_; |
| 379 bool spilled_; | 378 bool spilled_; |
| 379 bool is_double_; |
| 380 int assigned_register_; | 380 int assigned_register_; |
| 381 RegisterKind assigned_register_kind_; | |
| 382 UseInterval* last_interval_; | 381 UseInterval* last_interval_; |
| 383 UseInterval* first_interval_; | 382 UseInterval* first_interval_; |
| 384 UsePosition* first_pos_; | 383 UsePosition* first_pos_; |
| 385 LiveRange* parent_; | 384 LiveRange* parent_; |
| 386 LiveRange* next_; | 385 LiveRange* next_; |
| 387 // This is used as a cache, it doesn't affect correctness. | 386 // This is used as a cache, it doesn't affect correctness. |
| 388 mutable UseInterval* current_interval_; | 387 mutable UseInterval* current_interval_; |
| 389 UsePosition* last_processed_use_; | 388 UsePosition* last_processed_use_; |
| 390 LOperand* spill_operand_; | 389 LOperand* spill_operand_; |
| 391 int spill_start_index_; | 390 int spill_start_index_; |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 | 620 |
| 622 bool has_osr_entry_; | 621 bool has_osr_entry_; |
| 623 | 622 |
| 624 DISALLOW_COPY_AND_ASSIGN(LAllocator); | 623 DISALLOW_COPY_AND_ASSIGN(LAllocator); |
| 625 }; | 624 }; |
| 626 | 625 |
| 627 | 626 |
| 628 } } // namespace v8::internal | 627 } } // namespace v8::internal |
| 629 | 628 |
| 630 #endif // V8_LITHIUM_ALLOCATOR_H_ | 629 #endif // V8_LITHIUM_ALLOCATOR_H_ |
| OLD | NEW |