Commit f236777b authored by bmeurer's avatar bmeurer Committed by Commit bot

[x64] Use xorl to materialize smi zero.

Before we always loaded smi zero via a movabs with a 64-bit immediate,
which is pretty expensive compared to the xorl.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1085153002

Cr-Commit-Position: refs/heads/master@{#27829}
parent 4ceada05
......@@ -915,6 +915,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);
......@@ -926,7 +927,13 @@ Register MacroAssembler::GetSmiConstant(Smi* source) {
void MacroAssembler::LoadSmiConstant(Register dst, Smi* source) {
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());
}
}
......
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