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, ...@@ -343,29 +343,32 @@ void TurboAssembler::LoadCodeObjectEntry(Register destination,
DCHECK(root_array_available()); DCHECK(root_array_available());
Label if_code_is_off_heap, out; Label if_code_is_off_heap, out;
UseScratchRegisterScope temps(this); {
Register scratch = temps.Acquire(); UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
DCHECK(!AreAliased(destination, scratch));
DCHECK(!AreAliased(code_object, scratch)); 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) // Check whether the Code object is an off-heap trampoline. If so, call
// trampoline. Otherwise, just call the Code object as always. // its (off-heap) entry point directly without going through the (on-heap)
ldr(scratch, FieldMemOperand(code_object, Code::kFlagsOffset)); // trampoline. Otherwise, just call the Code object as always.
tst(scratch, Operand(Code::IsOffHeapTrampoline::kMask)); ldr(scratch, FieldMemOperand(code_object, Code::kFlagsOffset));
b(ne, &if_code_is_off_heap); 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(). // Not an off-heap trampoline, the entry point is at
add(destination, code_object, Operand(Code::kHeaderSize - kHeapObjectTag)); // Code::raw_instruction_start().
jmp(&out); add(destination, code_object,
Operand(Code::kHeaderSize - kHeapObjectTag));
// An off-heap trampoline, the entry point is loaded from the builtin entry jmp(&out);
// table.
bind(&if_code_is_off_heap); // An off-heap trampoline, the entry point is loaded from the builtin
ldr(scratch, FieldMemOperand(code_object, Code::kBuiltinIndexOffset)); // entry table.
lsl(destination, scratch, Operand(kSystemPointerSizeLog2)); bind(&if_code_is_off_heap);
ldr(scratch, FieldMemOperand(code_object, Code::kBuiltinIndexOffset));
lsl(destination, scratch, Operand(kSystemPointerSizeLog2));
}
add(destination, destination, kRootRegister); add(destination, destination, kRootRegister);
ldr(destination, ldr(destination,
MemOperand(destination, IsolateData::builtin_entry_table_offset())); 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