Commit 8d605323 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[ptr-compr][arm64] Add a switch for branchless/branchful decompression

Similar to x64's https://chromium-review.googlesource.com/c/v8/v8/+/1511486

Bug: v8:7703
Change-Id: Ifd634a36bb56a53cb9901d9dd0899b66229607ef
Cq-Include-Trybots: luci.v8.try:v8_linux64_arm64_pointer_compression_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1535828
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60412}
parent 95b09e3e
...@@ -2830,8 +2830,9 @@ void TurboAssembler::DecompressTaggedPointer(const Register& destination, ...@@ -2830,8 +2830,9 @@ void TurboAssembler::DecompressTaggedPointer(const Register& destination,
void TurboAssembler::DecompressAnyTagged(const Register& destination, void TurboAssembler::DecompressAnyTagged(const Register& destination,
const MemOperand& field_operand) { const MemOperand& field_operand) {
RecordComment("[ DecompressAnyTagged"); RecordComment("[ DecompressAnyTagged");
UseScratchRegisterScope temps(this);
Ldrsw(destination, field_operand); Ldrsw(destination, field_operand);
if (kUseBranchlessPtrDecompression) {
UseScratchRegisterScope temps(this);
// Branchlessly compute |masked_root|: // Branchlessly compute |masked_root|:
// masked_root = HAS_SMI_TAG(destination) ? 0 : kRootRegister; // masked_root = HAS_SMI_TAG(destination) ? 0 : kRootRegister;
STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag == 0)); STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag == 0));
...@@ -2839,9 +2840,15 @@ void TurboAssembler::DecompressAnyTagged(const Register& destination, ...@@ -2839,9 +2840,15 @@ void TurboAssembler::DecompressAnyTagged(const Register& destination,
// Sign extend tag bit to entire register. // Sign extend tag bit to entire register.
Sbfx(masked_root, destination, 0, kSmiTagSize); Sbfx(masked_root, destination, 0, kSmiTagSize);
And(masked_root, masked_root, kRootRegister); And(masked_root, masked_root, kRootRegister);
// Now this add operation will either leave the value unchanged if it is a smi // Now this add operation will either leave the value unchanged if it is a
// or add the isolate root if it is a heap object. // smi or add the isolate root if it is a heap object.
Add(destination, masked_root, destination); Add(destination, masked_root, destination);
} else {
Label done;
JumpIfSmi(destination, &done);
Add(destination, kRootRegister, destination);
bind(&done);
}
RecordComment("]"); RecordComment("]");
} }
......
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