Commit 37a38eba authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC: Disable CP on builtins

Also updated LoadConstantPoolPointerRegisterFromCodeTargetAddress
to add instruction size to the new constant_pool_offset.

Bug: v8:11036
Change-Id: Ib92a1b0606c60f82628d3e63ade54b312e4cf196
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2508691
Commit-Queue: Junliang Yan <junyan@redhat.com>
Reviewed-by: 's avatarMilad Fa <mfarazma@redhat.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70929}
parent 5d122bdc
...@@ -240,7 +240,9 @@ class V8_EXPORT_PRIVATE AssemblerBase : public Malloced { ...@@ -240,7 +240,9 @@ class V8_EXPORT_PRIVATE AssemblerBase : public Malloced {
bool is_constant_pool_available() const { bool is_constant_pool_available() const {
if (FLAG_enable_embedded_constant_pool) { if (FLAG_enable_embedded_constant_pool) {
return constant_pool_available_; // We need to disable constant pool here for embeded builtins
// because the metadata section is not adjacent to instructions
return constant_pool_available_ && !options().isolate_independent_code;
} else { } else {
// Embedded constant pool not supported on this architecture. // Embedded constant pool not supported on this architecture.
UNREACHABLE(); UNREACHABLE();
......
...@@ -1053,10 +1053,16 @@ void TurboAssembler::ShiftRightAlgPair(Register dst_low, Register dst_high, ...@@ -1053,10 +1053,16 @@ void TurboAssembler::ShiftRightAlgPair(Register dst_low, Register dst_high,
void TurboAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress( void TurboAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress(
Register code_target_address) { Register code_target_address) {
// Builtins do not use the constant pool (see is_constant_pool_available).
STATIC_ASSERT(Code::kOnHeapBodyIsContiguous);
lwz(r0, MemOperand(code_target_address,
Code::kInstructionSizeOffset - Code::kHeaderSize));
lwz(kConstantPoolRegister, lwz(kConstantPoolRegister,
MemOperand(code_target_address, MemOperand(code_target_address,
Code::kConstantPoolOffsetOffset - Code::kHeaderSize)); Code::kConstantPoolOffsetOffset - Code::kHeaderSize));
add(kConstantPoolRegister, kConstantPoolRegister, code_target_address); add(kConstantPoolRegister, kConstantPoolRegister, code_target_address);
add(kConstantPoolRegister, kConstantPoolRegister, r0);
} }
void TurboAssembler::LoadPC(Register dst) { void TurboAssembler::LoadPC(Register dst) {
...@@ -1072,6 +1078,10 @@ void TurboAssembler::ComputeCodeStartAddress(Register dst) { ...@@ -1072,6 +1078,10 @@ void TurboAssembler::ComputeCodeStartAddress(Register dst) {
} }
void TurboAssembler::LoadConstantPoolPointerRegister() { void TurboAssembler::LoadConstantPoolPointerRegister() {
//
// Builtins do not use the constant pool (see is_constant_pool_available).
STATIC_ASSERT(Code::kOnHeapBodyIsContiguous);
LoadPC(kConstantPoolRegister); LoadPC(kConstantPoolRegister);
int32_t delta = -pc_offset() + 4; int32_t delta = -pc_offset() + 4;
add_label_offset(kConstantPoolRegister, kConstantPoolRegister, add_label_offset(kConstantPoolRegister, kConstantPoolRegister,
......
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