Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: src/mips/assembler-mips-inl.h

Issue 1994143002: MIPS: Align emitting a trampoline pool to instruction size boundaries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/mips64/assembler-mips64-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/mips64/assembler-mips64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698