OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 rm_ = rm; | 458 rm_ = rm; |
459 rmode_ = kRelocInfo_NONEPTR; // PPC -why doesn't ARM do this? | 459 rmode_ = kRelocInfo_NONEPTR; // PPC -why doesn't ARM do this? |
460 } | 460 } |
461 | 461 |
462 void Assembler::CheckBuffer() { | 462 void Assembler::CheckBuffer() { |
463 if (buffer_space() <= kGap) { | 463 if (buffer_space() <= kGap) { |
464 GrowBuffer(); | 464 GrowBuffer(); |
465 } | 465 } |
466 } | 466 } |
467 | 467 |
| 468 void Assembler::TrackBranch() { |
| 469 DCHECK(!trampoline_emitted_); |
| 470 int count = tracked_branch_count_++; |
| 471 if (count == 0) { |
| 472 // We leave space (kMaxBlockTrampolineSectionSize) |
| 473 // for BlockTrampolinePoolScope buffer. |
| 474 next_trampoline_check_ = |
| 475 pc_offset() + kMaxCondBranchReach - kMaxBlockTrampolineSectionSize; |
| 476 } else { |
| 477 next_trampoline_check_ -= kTrampolineSlotsSize; |
| 478 } |
| 479 } |
| 480 |
| 481 void Assembler::UntrackBranch() { |
| 482 DCHECK(!trampoline_emitted_); |
| 483 DCHECK(tracked_branch_count_ > 0); |
| 484 int count = --tracked_branch_count_; |
| 485 if (count == 0) { |
| 486 // Reset |
| 487 next_trampoline_check_ = kMaxInt; |
| 488 } else { |
| 489 next_trampoline_check_ += kTrampolineSlotsSize; |
| 490 } |
| 491 } |
| 492 |
468 void Assembler::CheckTrampolinePoolQuick() { | 493 void Assembler::CheckTrampolinePoolQuick() { |
469 if (pc_offset() >= next_buffer_check_) { | 494 if (pc_offset() >= next_trampoline_check_) { |
470 CheckTrampolinePool(); | 495 CheckTrampolinePool(); |
471 } | 496 } |
472 } | 497 } |
473 | 498 |
474 void Assembler::emit(Instr x) { | 499 void Assembler::emit(Instr x) { |
475 CheckBuffer(); | 500 CheckBuffer(); |
476 *reinterpret_cast<Instr*>(pc_) = x; | 501 *reinterpret_cast<Instr*>(pc_) = x; |
477 pc_ += kInstrSize; | 502 pc_ += kInstrSize; |
478 CheckTrampolinePoolQuick(); | 503 CheckTrampolinePoolQuick(); |
479 } | 504 } |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 } | 746 } |
722 #endif | 747 #endif |
723 return; | 748 return; |
724 } | 749 } |
725 UNREACHABLE(); | 750 UNREACHABLE(); |
726 } | 751 } |
727 } | 752 } |
728 } // namespace v8::internal | 753 } // namespace v8::internal |
729 | 754 |
730 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ | 755 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ |
OLD | NEW |