Commit 3f7b797c authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS: Fix Assembler::dd(Label*) implementation.

BUG=
TEST=mjsunit/asm/embenchen/lua_binarytrees

Review URL: https://codereview.chromium.org/1127393003

Cr-Commit-Position: refs/heads/master@{#28303}
parent e7fcae36
......@@ -2580,15 +2580,15 @@ void Assembler::dd(uint32_t data) {
void Assembler::dd(Label* label) {
CheckBuffer();
RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
uint32_t data;
if (label->is_bound()) {
uint32_t data = reinterpret_cast<uint32_t>(buffer_ + label->pos());
*reinterpret_cast<uint32_t*>(pc_) = data;
pc_ += sizeof(uint32_t);
data = reinterpret_cast<uint32_t>(buffer_ + label->pos());
} else {
uint32_t target_pos = jump_address(label);
emit(target_pos);
data = jump_address(label);
internal_reference_positions_.insert(label->pos());
}
*reinterpret_cast<uint32_t*>(pc_) = data;
pc_ += sizeof(uint32_t);
}
......
......@@ -2756,15 +2756,15 @@ void Assembler::dd(uint32_t data) {
void Assembler::dd(Label* label) {
CheckBuffer();
RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
uint64_t data;
if (label->is_bound()) {
uint64_t data = reinterpret_cast<uint64_t>(buffer_ + label->pos());
*reinterpret_cast<uint64_t*>(pc_) = data;
pc_ += sizeof(uint64_t);
data = reinterpret_cast<uint64_t>(buffer_ + label->pos());
} else {
uint64_t target_pos = jump_address(label);
emit(target_pos);
data = jump_address(label);
internal_reference_positions_.insert(label->pos());
}
*reinterpret_cast<uint64_t*>(pc_) = data;
pc_ += sizeof(uint64_t);
}
......
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