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

Side by Side Diff: src/mips64/assembler-mips64-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 | « src/mips/assembler-mips-inl.h ('k') | no next file » | 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW
« no previous file with comments | « src/mips/assembler-mips-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698