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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 ClearCompactBranchState(); | 456 ClearCompactBranchState(); |
457 } | 457 } |
458 *reinterpret_cast<Instr*>(pc_) = x; | 458 *reinterpret_cast<Instr*>(pc_) = x; |
459 pc_ += kInstrSize; | 459 pc_ += kInstrSize; |
460 if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) { | 460 if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) { |
461 EmittedCompactBranchInstruction(); | 461 EmittedCompactBranchInstruction(); |
462 } | 462 } |
463 CheckTrampolinePoolQuick(); | 463 CheckTrampolinePoolQuick(); |
464 } | 464 } |
465 | 465 |
| 466 template <> |
| 467 inline void Assembler::EmitHelper(uint8_t x); |
466 | 468 |
467 template <typename T> | 469 template <typename T> |
468 void Assembler::EmitHelper(T x) { | 470 void Assembler::EmitHelper(T x) { |
469 *reinterpret_cast<T*>(pc_) = x; | 471 *reinterpret_cast<T*>(pc_) = x; |
470 pc_ += sizeof(x); | 472 pc_ += sizeof(x); |
471 CheckTrampolinePoolQuick(); | 473 CheckTrampolinePoolQuick(); |
472 } | 474 } |
473 | 475 |
| 476 template <> |
| 477 void Assembler::EmitHelper(uint8_t x) { |
| 478 *reinterpret_cast<uint8_t*>(pc_) = x; |
| 479 pc_ += sizeof(x); |
| 480 if (reinterpret_cast<intptr_t>(pc_) % kInstrSize == 0) { |
| 481 CheckTrampolinePoolQuick(); |
| 482 } |
| 483 } |
474 | 484 |
475 void Assembler::emit(Instr x, CompactBranchType is_compact_branch) { | 485 void Assembler::emit(Instr x, CompactBranchType is_compact_branch) { |
476 if (!is_buffer_growth_blocked()) { | 486 if (!is_buffer_growth_blocked()) { |
477 CheckBuffer(); | 487 CheckBuffer(); |
478 } | 488 } |
479 EmitHelper(x, is_compact_branch); | 489 EmitHelper(x, is_compact_branch); |
480 } | 490 } |
481 | 491 |
482 | 492 |
483 } // namespace internal | 493 } // namespace internal |
484 } // namespace v8 | 494 } // namespace v8 |
485 | 495 |
486 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ | 496 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ |
OLD | NEW |