Commit e9a0e0e5 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[nojit,x64] Tweak builtin pointer call sequence for pointer compression

This is to fix the pointer compression bot, which tests only x64.
Other 64-bit architectures will need similar work in the future.

On x64 with pointer compression, smi-untagging can be folded into the
Operand calculation since the left-shift for multiplying by
kSystemPointerSize is greater than the right-shift for untagging.

Bug: v8:7777
Change-Id: I5c46e9d3f51580341cfc3c12a7e32d17cf0b63ee
Reviewed-on: https://chromium-review.googlesource.com/c/1381452
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58328}
parent 682db784
...@@ -1638,18 +1638,28 @@ void TurboAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) { ...@@ -1638,18 +1638,28 @@ void TurboAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) {
} }
void TurboAssembler::CallBuiltinPointer(Register builtin_pointer) { void TurboAssembler::CallBuiltinPointer(Register builtin_pointer) {
#if defined(V8_COMPRESS_POINTERS) || defined(V8_31BIT_SMIS_ON_64BIT_ARCH)
STATIC_ASSERT(kSystemPointerSize == 8); STATIC_ASSERT(kSystemPointerSize == 8);
STATIC_ASSERT(kSmiShiftSize == 31); STATIC_ASSERT(kSmiShiftSize == 0);
STATIC_ASSERT(kSmiTagSize == 1); STATIC_ASSERT(kSmiTagSize == 1);
STATIC_ASSERT(kSmiTag == 0); STATIC_ASSERT(kSmiTag == 0);
// TODO(jgruber,ishell): With pointer compression, untagging could be folded // The builtin_pointer register contains the builtin index as a Smi.
// into the operand below. // Untagging is folded into the indexing operand below (we use times_4 instead
// of times_8 since smis are already shifted by one).
Call(Operand(kRootRegister, builtin_pointer, times_4,
IsolateData::builtin_entry_table_offset()));
#else // V8_COMPRESS_POINTERS
STATIC_ASSERT(kSystemPointerSize == 8);
STATIC_ASSERT(kSmiShiftSize == 31);
STATIC_ASSERT(kSmiTagSize == 1);
STATIC_ASSERT(kSmiTag == 0);
// The builtin_pointer register contains the builtin index as a Smi. // The builtin_pointer register contains the builtin index as a Smi.
SmiUntag(builtin_pointer, builtin_pointer); SmiUntag(builtin_pointer, builtin_pointer);
Call(Operand(kRootRegister, builtin_pointer, times_8, Call(Operand(kRootRegister, builtin_pointer, times_8,
IsolateData::builtin_entry_table_offset())); IsolateData::builtin_entry_table_offset()));
#endif // defined(V8_COMPRESS_POINTERS) || defined(V8_31BIT_SMIS_ON_64BIT_ARCH)
} }
void TurboAssembler::RetpolineCall(Register reg) { void TurboAssembler::RetpolineCall(Register reg) {
......
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