Commit 7f903125 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC: use pc-relative address to init constpool reg

R=joransiu@ca.ibm.com

Change-Id: I67364f29d494b09786a14b13743f73bef4b64582
Reviewed-on: https://chromium-review.googlesource.com/950242
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#51750}
parent f0946c1b
......@@ -168,7 +168,7 @@ void TurboAssembler::Call(Register target) {
}
void MacroAssembler::CallJSEntry(Register target) {
DCHECK(target == ip);
CHECK(target == r5);
Call(target);
}
......@@ -825,7 +825,7 @@ void TurboAssembler::ShiftRightAlgPair(Register dst_low, Register dst_high,
}
#endif
void MacroAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress(
void TurboAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress(
Register code_target_address) {
lwz(kConstantPoolRegister,
MemOperand(code_target_address,
......@@ -833,8 +833,15 @@ void MacroAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress(
add(kConstantPoolRegister, kConstantPoolRegister, code_target_address);
}
void TurboAssembler::LoadPC(Register dst) {
b(4, SetLK);
mflr(dst);
}
void TurboAssembler::LoadConstantPoolPointerRegister() {
mov_label_addr(kConstantPoolRegister, ConstantPoolPosition());
LoadPC(kConstantPoolRegister);
add_label_offset(kConstantPoolRegister, kConstantPoolRegister,
ConstantPoolPosition(), -pc_offset() + 4);
}
void TurboAssembler::StubPrologue(StackFrame::Type type) {
......@@ -850,7 +857,6 @@ void TurboAssembler::StubPrologue(StackFrame::Type type) {
}
void TurboAssembler::Prologue() {
DCHECK(base != no_reg);
PushStandardFrame(r4);
if (FLAG_enable_embedded_constant_pool) {
// base contains prologue address
......
......@@ -216,6 +216,7 @@ class TurboAssembler : public Assembler {
Register scratch = no_reg);
void LoadSingleU(DoubleRegister dst, const MemOperand& mem,
Register scratch = no_reg);
void LoadPC(Register dst);
void StoreDouble(DoubleRegister src, const MemOperand& mem,
Register scratch = no_reg);
......@@ -641,6 +642,10 @@ class TurboAssembler : public Assembler {
void CallStubDelayed(CodeStub* stub);
void LoadConstantPoolPointerRegister();
// Loads the constant pool pointer (kConstantPoolRegister).
void LoadConstantPoolPointerRegisterFromCodeTargetAddress(
Register code_target_address);
void AbortConstantPoolBuilding() {
#ifdef DEBUG
// Avoid DCHECK(!is_linked()) failure in ~Label()
......@@ -735,10 +740,6 @@ class MacroAssembler : public TurboAssembler {
void PushSafepointRegisters();
void PopSafepointRegisters();
// Loads the constant pool pointer (kConstantPoolRegister).
void LoadConstantPoolPointerRegisterFromCodeTargetAddress(
Register code_target_address);
// Flush the I-cache from asm code. You should use CpuFeatures::FlushICache
// from C.
// Does not handle errors.
......
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