Commit 7f0ed5cb authored by Frank Tang's avatar Frank Tang Committed by V8 LUCI CQ

[arm] Prepare CallFunction builtin for more roots

The old implementation had an implicit assumption that
IsolateData::builtin_entry_table_offset is a uint12, i.e.
<4096. We're about to cross that threshold, so this patch
frees up a temp register to let the code generator handle
larger offsets.

Bug: v8:12110
Change-Id: I2c313918be4b1c4fdd2984259e5e8cc02bb24035
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3097108Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76350}
parent b7efdc05
......@@ -343,29 +343,32 @@ void TurboAssembler::LoadCodeObjectEntry(Register destination,
DCHECK(root_array_available());
Label if_code_is_off_heap, out;
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
DCHECK(!AreAliased(destination, scratch));
DCHECK(!AreAliased(code_object, scratch));
// Check whether the Code object is an off-heap trampoline. If so, call its
// (off-heap) entry point directly without going through the (on-heap)
// trampoline. Otherwise, just call the Code object as always.
ldr(scratch, FieldMemOperand(code_object, Code::kFlagsOffset));
tst(scratch, Operand(Code::IsOffHeapTrampoline::kMask));
b(ne, &if_code_is_off_heap);
// Not an off-heap trampoline, the entry point is at
// Code::raw_instruction_start().
add(destination, code_object, Operand(Code::kHeaderSize - kHeapObjectTag));
jmp(&out);
// An off-heap trampoline, the entry point is loaded from the builtin entry
// table.
bind(&if_code_is_off_heap);
ldr(scratch, FieldMemOperand(code_object, Code::kBuiltinIndexOffset));
lsl(destination, scratch, Operand(kSystemPointerSizeLog2));
{
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
DCHECK(!AreAliased(destination, scratch));
DCHECK(!AreAliased(code_object, scratch));
// Check whether the Code object is an off-heap trampoline. If so, call
// its (off-heap) entry point directly without going through the (on-heap)
// trampoline. Otherwise, just call the Code object as always.
ldr(scratch, FieldMemOperand(code_object, Code::kFlagsOffset));
tst(scratch, Operand(Code::IsOffHeapTrampoline::kMask));
b(ne, &if_code_is_off_heap);
// Not an off-heap trampoline, the entry point is at
// Code::raw_instruction_start().
add(destination, code_object,
Operand(Code::kHeaderSize - kHeapObjectTag));
jmp(&out);
// An off-heap trampoline, the entry point is loaded from the builtin
// entry table.
bind(&if_code_is_off_heap);
ldr(scratch, FieldMemOperand(code_object, Code::kBuiltinIndexOffset));
lsl(destination, scratch, Operand(kSystemPointerSizeLog2));
}
add(destination, destination, kRootRegister);
ldr(destination,
MemOperand(destination, IsolateData::builtin_entry_table_offset()));
......
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