Commit 31668eb2 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[arm] remove obsolete ip-preserving code in LoadFromConstantsTable

The code in TurboAssembler::LoadFromConstantsTable uses special code
to avoid clobbering the scratch register ip by giving different
argument registers to ldr. This used to be motivated by
DirectCEntryStub::GenerateCall relying on LookupConstant not clobbering
ip (see https://crrev.com/c/1070980). Now that this code is gone,
there is no more reason for preserving ip and it's fragile, so it's better
to remove this special handling.

Bug: v8:10077
Change-Id: I683d7c63e2a3c8ba554cd99299206ed9e5df835d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1981160Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65625}
parent 6bfaba07
......@@ -121,27 +121,11 @@ void TurboAssembler::LoadFromConstantsTable(Register destination,
int constant_index) {
DCHECK(RootsTable::IsImmortalImmovable(RootIndex::kBuiltinsConstantsTable));
// The ldr call below could end up clobbering ip when the offset does not fit
// into 12 bits (and thus needs to be loaded from the constant pool). In that
// case, we need to be extra-careful and temporarily use another register as
// the target.
const uint32_t offset =
FixedArray::kHeaderSize + constant_index * kPointerSize - kHeapObjectTag;
const bool could_clobber_ip = !is_uint12(offset);
Register reg = destination;
if (could_clobber_ip) {
reg = destination != r7 ? r7 : r8;
Push(reg);
}
LoadRoot(reg, RootIndex::kBuiltinsConstantsTable);
ldr(destination, MemOperand(reg, offset));
if (could_clobber_ip) {
Pop(reg);
}
LoadRoot(destination, RootIndex::kBuiltinsConstantsTable);
ldr(destination, MemOperand(destination, offset));
}
void TurboAssembler::LoadRootRelative(Register destination, int32_t 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