OLD | NEW |
1 | 1 |
2 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 2 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
3 // All Rights Reserved. | 3 // All Rights Reserved. |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // - Redistributions of source code must retain the above copyright notice, | 9 // - Redistributions of source code must retain the above copyright notice, |
10 // this list of conditions and the following disclaimer. | 10 // this list of conditions and the following disclaimer. |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 // Assembler. | 486 // Assembler. |
487 | 487 |
488 | 488 |
489 void Assembler::CheckBuffer() { | 489 void Assembler::CheckBuffer() { |
490 if (buffer_space() <= kGap) { | 490 if (buffer_space() <= kGap) { |
491 GrowBuffer(); | 491 GrowBuffer(); |
492 } | 492 } |
493 } | 493 } |
494 | 494 |
495 | 495 |
496 void Assembler::CheckTrampolinePoolQuick() { | 496 void Assembler::CheckTrampolinePoolQuick(int extra_instructions) { |
497 if (pc_offset() >= next_buffer_check_) { | 497 if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) { |
498 CheckTrampolinePool(); | 498 CheckTrampolinePool(); |
499 } | 499 } |
500 } | 500 } |
501 | 501 |
502 | 502 |
503 void Assembler::emit(Instr x) { | 503 void Assembler::emit(Instr x) { |
504 if (!is_buffer_growth_blocked()) { | 504 if (!is_buffer_growth_blocked()) { |
505 CheckBuffer(); | 505 CheckBuffer(); |
506 } | 506 } |
507 *reinterpret_cast<Instr*>(pc_) = x; | 507 *reinterpret_cast<Instr*>(pc_) = x; |
508 pc_ += kInstrSize; | 508 pc_ += kInstrSize; |
509 CheckTrampolinePoolQuick(); | 509 CheckTrampolinePoolQuick(); |
510 } | 510 } |
511 | 511 |
512 | 512 |
513 void Assembler::emit(uint64_t x) { | 513 void Assembler::emit(uint64_t x) { |
514 if (!is_buffer_growth_blocked()) { | 514 if (!is_buffer_growth_blocked()) { |
515 CheckBuffer(); | 515 CheckBuffer(); |
516 } | 516 } |
517 *reinterpret_cast<uint64_t*>(pc_) = x; | 517 *reinterpret_cast<uint64_t*>(pc_) = x; |
518 pc_ += kInstrSize * 2; | 518 pc_ += kInstrSize * 2; |
519 CheckTrampolinePoolQuick(); | 519 CheckTrampolinePoolQuick(); |
520 } | 520 } |
521 | 521 |
522 | 522 |
523 } } // namespace v8::internal | 523 } } // namespace v8::internal |
524 | 524 |
525 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ | 525 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ |
OLD | NEW |