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