Commit 65aa64ac authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS: Align emitting a trampoline pool to instruction size boundaries.

Assembler::db() could start a trampoline pool at wrong pc position.

TEST: mjsunit/asm/embenchen/zlib

BUG=

Review-Url: https://codereview.chromium.org/1994143002
Cr-Commit-Position: refs/heads/master@{#36374}
parent 0cc77049
......@@ -463,6 +463,8 @@ void Assembler::EmitHelper(Instr x, CompactBranchType is_compact_branch) {
CheckTrampolinePoolQuick();
}
template <>
inline void Assembler::EmitHelper(uint8_t x);
template <typename T>
void Assembler::EmitHelper(T x) {
......@@ -471,6 +473,14 @@ void Assembler::EmitHelper(T x) {
CheckTrampolinePoolQuick();
}
template <>
void Assembler::EmitHelper(uint8_t x) {
*reinterpret_cast<uint8_t*>(pc_) = x;
pc_ += sizeof(x);
if (reinterpret_cast<intptr_t>(pc_) % kInstrSize == 0) {
CheckTrampolinePoolQuick();
}
}
void Assembler::emit(Instr x, CompactBranchType is_compact_branch) {
if (!is_buffer_growth_blocked()) {
......
......@@ -445,6 +445,8 @@ void Assembler::EmitHelper(Instr x, CompactBranchType is_compact_branch) {
CheckTrampolinePoolQuick();
}
template <>
inline void Assembler::EmitHelper(uint8_t x);
template <typename T>
void Assembler::EmitHelper(T x) {
......@@ -453,6 +455,14 @@ void Assembler::EmitHelper(T x) {
CheckTrampolinePoolQuick();
}
template <>
void Assembler::EmitHelper(uint8_t x) {
*reinterpret_cast<uint8_t*>(pc_) = x;
pc_ += sizeof(x);
if (reinterpret_cast<intptr_t>(pc_) % kInstrSize == 0) {
CheckTrampolinePoolQuick();
}
}
void Assembler::emit(Instr x, CompactBranchType is_compact_branch) {
if (!is_buffer_growth_blocked()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment