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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } | 438 } |
439 | 439 |
440 | 440 |
441 void Assembler::CheckTrampolinePoolQuick(int extra_instructions) { | 441 void Assembler::CheckTrampolinePoolQuick(int extra_instructions) { |
442 if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) { | 442 if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) { |
443 CheckTrampolinePool(); | 443 CheckTrampolinePool(); |
444 } | 444 } |
445 } | 445 } |
446 | 446 |
447 | 447 |
448 void Assembler::emit(Instr x) { | 448 void Assembler::emit(Instr x, CompactBranchType is_compact_branch) { |
449 if (!is_buffer_growth_blocked()) { | 449 if (!is_buffer_growth_blocked()) { |
450 CheckBuffer(); | 450 CheckBuffer(); |
451 } | 451 } |
| 452 if (IsPrevInstrCompactBranch()) { |
| 453 if (Instruction::IsForbiddenAfterBranchInstr(x)) { |
| 454 // Nop instruction to preceed a CTI in forbidden slot: |
| 455 Instr nop = SPECIAL | SLL; |
| 456 *reinterpret_cast<Instr*>(pc_) = nop; |
| 457 pc_ += kInstrSize; |
| 458 } |
| 459 ClearCompactBranchState(); |
| 460 } |
452 *reinterpret_cast<Instr*>(pc_) = x; | 461 *reinterpret_cast<Instr*>(pc_) = x; |
453 pc_ += kInstrSize; | 462 pc_ += kInstrSize; |
| 463 if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) { |
| 464 EmittedCompactBranchInstruction(); |
| 465 } |
454 CheckTrampolinePoolQuick(); | 466 CheckTrampolinePoolQuick(); |
455 } | 467 } |
456 | 468 |
457 | 469 |
458 } // namespace internal | 470 } // namespace internal |
459 } // namespace v8 | 471 } // namespace v8 |
460 | 472 |
461 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ | 473 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ |
OLD | NEW |