PPC: fix offset overflow and dcheck failure

R=joransiu@ca.ibm.com

Change-Id: I0587b286f3132347172f353cbce405158ef1c403
Reviewed-on: https://chromium-review.googlesource.com/c/1393910
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#58523}
This commit is contained in:
Junliang Yan 2019-01-02 23:57:32 -05:00 committed by Commit Bot
parent 20b6330037
commit 3bf55e7889

View File

@ -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