diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc index efe9004440..88ef9824f8 100644 --- a/src/x64/macro-assembler-x64.cc +++ b/src/x64/macro-assembler-x64.cc @@ -1100,6 +1100,7 @@ void MacroAssembler::SafePush(Smi* src) { Register MacroAssembler::GetSmiConstant(Smi* source) { + STATIC_ASSERT(kSmiTag == 0); int value = source->value(); if (value == 0) { xorl(kScratchRegister, kScratchRegister); @@ -1111,9 +1112,13 @@ Register MacroAssembler::GetSmiConstant(Smi* source) { void MacroAssembler::LoadSmiConstant(Register dst, Smi* source) { - // Special-casing 0 here to use xorl seems to make things slower, so we don't - // do it. - Move(dst, source, Assembler::RelocInfoNone()); + STATIC_ASSERT(kSmiTag == 0); + int value = source->value(); + if (value == 0) { + xorl(dst, dst); + } else { + Move(dst, source, Assembler::RelocInfoNone()); + } }