Commit 8109b479 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[ptr-compr] Remove unnecessary decompression in kArchStoreWithWriteBarrier

The object itself is already decompressed, and we're simply re-decompressing by
nuking the upper bits through sign extension.

Additionally this CL changes the branchless decompression sequence on x64 to be
cmov-based since that's shorter and faster. It's still slower than branchful
though, so we likely won't use it.

Change-Id: Ie6f9d38fb390b7300a236bf85d0db58d1ee959b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1701842Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62708}
parent 56eaec9d
...@@ -322,10 +322,9 @@ void TurboAssembler::DecompressRegisterAnyTagged(Register destination, ...@@ -322,10 +322,9 @@ void TurboAssembler::DecompressRegisterAnyTagged(Register destination,
// masked_root = HAS_SMI_TAG(destination) ? 0 : kRootRegister; // masked_root = HAS_SMI_TAG(destination) ? 0 : kRootRegister;
STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag < 32)); STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag < 32));
Register masked_root = scratch; Register masked_root = scratch;
movl(masked_root, destination); xorq(masked_root, masked_root);
andl(masked_root, Immediate(kSmiTagMask)); Condition smi = CheckSmi(destination);
negq(masked_root); cmovq(NegateCondition(smi), masked_root, kRootRegister);
andq(masked_root, kRootRegister);
// Now this add operation will either leave the value unchanged if it is // Now this add operation will either leave the value unchanged if it is
// a smi or add the isolate root if it is a heap object. // a smi or add the isolate root if it is a heap object.
addq(destination, masked_root); addq(destination, masked_root);
......
...@@ -866,9 +866,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -866,9 +866,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
this, object, offset, value, mode, DetermineStubCallMode(), this, object, offset, value, mode, DetermineStubCallMode(),
&unwinding_info_writer_); &unwinding_info_writer_);
__ StoreTaggedField(value, MemOperand(object, offset)); __ StoreTaggedField(value, MemOperand(object, offset));
if (COMPRESS_POINTERS_BOOL) {
__ DecompressTaggedPointer(object, object);
}
__ CheckPageFlag(object, MemoryChunk::kPointersFromHereAreInterestingMask, __ CheckPageFlag(object, MemoryChunk::kPointersFromHereAreInterestingMask,
eq, ool->entry()); eq, ool->entry());
__ Bind(ool->exit()); __ Bind(ool->exit());
......
...@@ -1041,9 +1041,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1041,9 +1041,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
OutOfLineRecordWrite(this, object, operand, value, scratch0, scratch1, OutOfLineRecordWrite(this, object, operand, value, scratch0, scratch1,
mode, DetermineStubCallMode()); mode, DetermineStubCallMode());
__ StoreTaggedField(operand, value); __ StoreTaggedField(operand, value);
if (COMPRESS_POINTERS_BOOL) {
__ DecompressTaggedPointer(object, object);
}
__ CheckPageFlag(object, scratch0, __ CheckPageFlag(object, scratch0,
MemoryChunk::kPointersFromHereAreInterestingMask, MemoryChunk::kPointersFromHereAreInterestingMask,
not_zero, ool->entry()); not_zero, ool->entry());
......
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