Commit 3bf55e78 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC: fix offset overflow and dcheck failure

R=joransiu@ca.ibm.com

Change-Id: I0587b286f3132347172f353cbce405158ef1c403
Reviewed-on: https://chromium-review.googlesource.com/c/1393910Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#58523}
parent 20b63300
......@@ -141,8 +141,11 @@ void TurboAssembler::LoadRootRegisterOffset(Register destination,
intptr_t offset) {
if (offset == 0) {
mr(destination, kRootRegister);
} else {
} else if (is_int16(offset)) {
addi(destination, kRootRegister, Operand(offset));
} else {
mov(destination, Operand(offset));
add(destination, kRootRegister, destination);
}
}
......@@ -3036,7 +3039,7 @@ void TurboAssembler::StoreReturnAddressAndCall(Register target) {
StoreP(r7, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize));
Call(target);
DCHECK_EQ(after_call_offset - kInstrSize,
__ SizeOfCodeGeneratedSince(&start_call));
SizeOfCodeGeneratedSince(&start_call));
}
} // namespace internal
......
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