[x64] Use slightly shorter code for AssertZeroExtended

Instead of loading {kMaxUInt32 + 1} (or 2^31) as a 64-bit constant, load
{kMaxUInt32} as a 32-bit constant. This saves four bytes on debug-code
enabled builds (i.e. mostly debug builds).

R=thibaudm@chromium.org

Change-Id: I58a5fac9f94df6cb6dbc22dfc33e191765ef0622
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4096738
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84879}
This commit is contained in:
Clemens Backes 2022-12-12 12:43:12 +01:00 committed by V8 LUCI CQ
parent ea644a93d0
commit bc078aed99

View File

@ -2715,9 +2715,9 @@ void TurboAssembler::AssertZeroExtended(Register int32_register) {
if (!v8_flags.debug_code) return;
ASM_CODE_COMMENT(this);
DCHECK_NE(int32_register, kScratchRegister);
movq(kScratchRegister, int64_t{0x0000000100000000});
cmpq(kScratchRegister, int32_register);
Check(above, AbortReason::k32BitValueInRegisterIsNotZeroExtended);
movl(kScratchRegister, Immediate(kMaxUInt32)); // zero-extended
cmpq(int32_register, kScratchRegister);
Check(below_equal, AbortReason::k32BitValueInRegisterIsNotZeroExtended);
}
void TurboAssembler::AssertSignedBitOfSmiIsZero(Register smi_register) {