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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 // Returns use position for which register is required in this live | 304 // Returns use position for which register is required in this live |
305 // range and which follows both start and last processed use position | 305 // range and which follows both start and last processed use position |
306 // Modifies internal state of live range! | 306 // Modifies internal state of live range! |
307 UsePosition* NextRegisterPosition(LifetimePosition start); | 307 UsePosition* NextRegisterPosition(LifetimePosition start); |
308 | 308 |
309 // Returns use position for which register is beneficial in this live | 309 // Returns use position for which register is beneficial in this live |
310 // range and which follows both start and last processed use position | 310 // range and which follows both start and last processed use position |
311 // Modifies internal state of live range! | 311 // Modifies internal state of live range! |
312 UsePosition* NextUsePositionRegisterIsBeneficial(LifetimePosition start); | 312 UsePosition* NextUsePositionRegisterIsBeneficial(LifetimePosition start); |
313 | 313 |
| 314 // Returns use position for which register is beneficial in this live |
| 315 // range and which precedes start. |
| 316 UsePosition* PreviousUsePositionRegisterIsBeneficial(LifetimePosition start); |
| 317 |
314 // Can this live range be spilled at this position. | 318 // Can this live range be spilled at this position. |
315 bool CanBeSpilled(LifetimePosition pos); | 319 bool CanBeSpilled(LifetimePosition pos); |
316 | 320 |
317 // Split this live range at the given position which must follow the start of | 321 // Split this live range at the given position which must follow the start of |
318 // the range. | 322 // the range. |
319 // All uses following the given position will be moved from this | 323 // All uses following the given position will be moved from this |
320 // live range to the result live range. | 324 // live range to the result live range. |
321 void SplitAt(LifetimePosition position, LiveRange* result, Zone* zone); | 325 void SplitAt(LifetimePosition position, LiveRange* result, Zone* zone); |
322 | 326 |
323 bool IsDouble() const { return is_double_; } | 327 bool IsDouble() const { return is_double_; } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 // Spill the given life range after position pos. | 560 // Spill the given life range after position pos. |
557 void SpillAfter(LiveRange* range, LifetimePosition pos); | 561 void SpillAfter(LiveRange* range, LifetimePosition pos); |
558 | 562 |
559 // Spill the given life range after position start and up to position end. | 563 // Spill the given life range after position start and up to position end. |
560 void SpillBetween(LiveRange* range, | 564 void SpillBetween(LiveRange* range, |
561 LifetimePosition start, | 565 LifetimePosition start, |
562 LifetimePosition end); | 566 LifetimePosition end); |
563 | 567 |
564 void SplitAndSpillIntersecting(LiveRange* range); | 568 void SplitAndSpillIntersecting(LiveRange* range); |
565 | 569 |
| 570 // If we are trying to spill a range inside the loop try to |
| 571 // hoist spill position out to the point just before the loop. |
| 572 LifetimePosition FindOptimalSpillingPos(LiveRange* range, |
| 573 LifetimePosition pos); |
| 574 |
566 void Spill(LiveRange* range); | 575 void Spill(LiveRange* range); |
567 bool IsBlockBoundary(LifetimePosition pos); | 576 bool IsBlockBoundary(LifetimePosition pos); |
568 | 577 |
569 // Helper methods for resolving control flow. | 578 // Helper methods for resolving control flow. |
570 void ResolveControlFlow(LiveRange* range, | 579 void ResolveControlFlow(LiveRange* range, |
571 HBasicBlock* block, | 580 HBasicBlock* block, |
572 HBasicBlock* pred); | 581 HBasicBlock* pred); |
573 | 582 |
574 // Return parallel move that should be used to connect ranges split at the | 583 // Return parallel move that should be used to connect ranges split at the |
575 // given position. | 584 // given position. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 // Indicates success or failure during register allocation. | 641 // Indicates success or failure during register allocation. |
633 bool allocation_ok_; | 642 bool allocation_ok_; |
634 | 643 |
635 DISALLOW_COPY_AND_ASSIGN(LAllocator); | 644 DISALLOW_COPY_AND_ASSIGN(LAllocator); |
636 }; | 645 }; |
637 | 646 |
638 | 647 |
639 } } // namespace v8::internal | 648 } } // namespace v8::internal |
640 | 649 |
641 #endif // V8_LITHIUM_ALLOCATOR_H_ | 650 #endif // V8_LITHIUM_ALLOCATOR_H_ |
OLD | NEW |