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 ClearCompactBranchState(); | 438 ClearCompactBranchState(); |
439 } | 439 } |
440 *reinterpret_cast<Instr*>(pc_) = x; | 440 *reinterpret_cast<Instr*>(pc_) = x; |
441 pc_ += kInstrSize; | 441 pc_ += kInstrSize; |
442 if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) { | 442 if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) { |
443 EmittedCompactBranchInstruction(); | 443 EmittedCompactBranchInstruction(); |
444 } | 444 } |
445 CheckTrampolinePoolQuick(); | 445 CheckTrampolinePoolQuick(); |
446 } | 446 } |
447 | 447 |
| 448 template <> |
| 449 inline void Assembler::EmitHelper(uint8_t x); |
448 | 450 |
449 template <typename T> | 451 template <typename T> |
450 void Assembler::EmitHelper(T x) { | 452 void Assembler::EmitHelper(T x) { |
451 *reinterpret_cast<T*>(pc_) = x; | 453 *reinterpret_cast<T*>(pc_) = x; |
452 pc_ += sizeof(x); | 454 pc_ += sizeof(x); |
453 CheckTrampolinePoolQuick(); | 455 CheckTrampolinePoolQuick(); |
454 } | 456 } |
455 | 457 |
| 458 template <> |
| 459 void Assembler::EmitHelper(uint8_t x) { |
| 460 *reinterpret_cast<uint8_t*>(pc_) = x; |
| 461 pc_ += sizeof(x); |
| 462 if (reinterpret_cast<intptr_t>(pc_) % kInstrSize == 0) { |
| 463 CheckTrampolinePoolQuick(); |
| 464 } |
| 465 } |
456 | 466 |
457 void Assembler::emit(Instr x, CompactBranchType is_compact_branch) { | 467 void Assembler::emit(Instr x, CompactBranchType is_compact_branch) { |
458 if (!is_buffer_growth_blocked()) { | 468 if (!is_buffer_growth_blocked()) { |
459 CheckBuffer(); | 469 CheckBuffer(); |
460 } | 470 } |
461 EmitHelper(x, is_compact_branch); | 471 EmitHelper(x, is_compact_branch); |
462 } | 472 } |
463 | 473 |
464 | 474 |
465 void Assembler::emit(uint64_t data) { | 475 void Assembler::emit(uint64_t data) { |
466 CheckForEmitInForbiddenSlot(); | 476 CheckForEmitInForbiddenSlot(); |
467 EmitHelper(data); | 477 EmitHelper(data); |
468 } | 478 } |
469 | 479 |
470 | 480 |
471 } // namespace internal | 481 } // namespace internal |
472 } // namespace v8 | 482 } // namespace v8 |
473 | 483 |
474 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ | 484 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ |
OLD | NEW |