Commit 74895882 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

Revert "[ptr-compr] Fix 32-bit smis on non-ptr-compr builds"

This reverts commit aa984947.

Reason for revert: Unexpectedly regresses SixSpeed benchmarks. Will reland a fix without refactoring.

Original change's description:
> [ptr-compr] Fix 32-bit smis on non-ptr-compr builds
> 
> Bug: v8:10047, v8:10257
> Change-Id: Ifcc65235726420fe753e26707d84061400d5d2b1
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2050384
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66415}

TBR=ishell@chromium.org,verwaest@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: v8:10047, v8:10257
Change-Id: Ic3253652adcce457cf0810baa0eb09cc9a383ceb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2077913Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66481}
parent a6b6343a
......@@ -1213,11 +1213,9 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ bind(&stack_check_interrupt);
// Modify the bytecode offset in the stack to be kFunctionEntryBytecodeOffset
// for the call to the StackGuard.
__ Move(kScratchRegister,
Smi::FromInt(BytecodeArray::kHeaderSize - kHeapObjectTag +
kFunctionEntryBytecodeOffset));
__ movq(Operand(rbp, InterpreterFrameConstants::kBytecodeOffsetFromFp),
kScratchRegister);
Immediate(Smi::FromInt(BytecodeArray::kHeaderSize - kHeapObjectTag +
kFunctionEntryBytecodeOffset)));
__ CallRuntime(Runtime::kStackGuard);
// After the call, restore the bytecode array, bytecode offset and accumulator
......
......@@ -1028,7 +1028,17 @@ void TurboAssembler::Set(Operand dst, intptr_t x) {
// Smi tagging, untagging and tag detection.
Register TurboAssembler::GetSmiConstant(Smi source) {
Move(kScratchRegister, source);
STATIC_ASSERT(kSmiTag == 0);
int value = source.value();
if (value == 0) {
xorl(kScratchRegister, kScratchRegister);
return kScratchRegister;
}
if (SmiValuesAre32Bits()) {
Move(kScratchRegister, source);
} else {
movl(kScratchRegister, Immediate(source));
}
return kScratchRegister;
}
......@@ -1038,11 +1048,7 @@ void TurboAssembler::Move(Register dst, Smi source) {
if (value == 0) {
xorl(dst, dst);
} else {
if (COMPRESS_POINTERS_BOOL) {
movl(dst, Immediate(source));
} else {
Move(dst, source.ptr(), RelocInfo::NONE);
}
Move(dst, source.ptr(), RelocInfo::NONE);
}
}
......
......@@ -383,6 +383,11 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void Move(Register dst, Smi source);
void Move(Operand dst, Smi source) {
Register constant = GetSmiConstant(source);
movq(dst, constant);
}
void Move(Register dst, ExternalReference ext);
void Move(XMMRegister dst, uint32_t src);
......
......@@ -94,7 +94,7 @@ static void TestMoveSmi(MacroAssembler* masm, Label* exit, int id, Smi value) {
__ movl(rax, Immediate(id));
__ Move(rcx, value);
__ Set(rdx, static_cast<intptr_t>(value.ptr()));
__ cmp_tagged(rcx, rdx);
__ cmpq(rcx, rdx);
__ j(not_equal, exit);
}
......
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