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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 } | 419 } |
420 const Vector<LiveRange*>* fixed_double_live_ranges() const { | 420 const Vector<LiveRange*>* fixed_double_live_ranges() const { |
421 return &fixed_double_live_ranges_; | 421 return &fixed_double_live_ranges_; |
422 } | 422 } |
423 | 423 |
424 LPlatformChunk* chunk() const { return chunk_; } | 424 LPlatformChunk* chunk() const { return chunk_; } |
425 HGraph* graph() const { return graph_; } | 425 HGraph* graph() const { return graph_; } |
426 Zone* zone() const { return zone_; } | 426 Zone* zone() const { return zone_; } |
427 | 427 |
428 int GetVirtualRegister() { | 428 int GetVirtualRegister() { |
429 if (next_virtual_register_ > LUnallocated::kMaxVirtualRegisters) { | 429 if (next_virtual_register_ >= LUnallocated::kMaxVirtualRegisters) { |
430 allocation_ok_ = false; | 430 allocation_ok_ = false; |
| 431 // Maintain the invariant that we return something below the maximum. |
| 432 return 0; |
431 } | 433 } |
432 return next_virtual_register_++; | 434 return next_virtual_register_++; |
433 } | 435 } |
434 | 436 |
435 bool AllocationOk() { return allocation_ok_; } | 437 bool AllocationOk() { return allocation_ok_; } |
436 | 438 |
437 void MarkAsOsrEntry() { | 439 void MarkAsOsrEntry() { |
438 // There can be only one. | 440 // There can be only one. |
439 ASSERT(!has_osr_entry_); | 441 ASSERT(!has_osr_entry_); |
440 // Simply set a flag to find and process instruction later. | 442 // Simply set a flag to find and process instruction later. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 // Indicates success or failure during register allocation. | 615 // Indicates success or failure during register allocation. |
614 bool allocation_ok_; | 616 bool allocation_ok_; |
615 | 617 |
616 DISALLOW_COPY_AND_ASSIGN(LAllocator); | 618 DISALLOW_COPY_AND_ASSIGN(LAllocator); |
617 }; | 619 }; |
618 | 620 |
619 | 621 |
620 } } // namespace v8::internal | 622 } } // namespace v8::internal |
621 | 623 |
622 #endif // V8_LITHIUM_ALLOCATOR_H_ | 624 #endif // V8_LITHIUM_ALLOCATOR_H_ |
OLD | NEW |