Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 88f61d4725751b647b3a8b7ad40a156011db2bd5..bab0199354d5e546fb8775f67a7c86b3566e80a5 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -882,13 +882,21 @@ Condition MacroAssembler::CheckBothPositiveSmi(Register first, |
} |
-Condition MacroAssembler::CheckEitherSmi(Register first, Register second) { |
+Condition MacroAssembler::CheckEitherSmi(Register first, |
+ Register second, |
+ Register scratch) { |
if (first.is(second)) { |
return CheckSmi(first); |
} |
- movl(kScratchRegister, first); |
- andl(kScratchRegister, second); |
- testb(kScratchRegister, Immediate(kSmiTagMask)); |
+ if (scratch.is(second)) { |
+ andl(scratch, first); |
+ } else { |
+ if (!scratch.is(first)) { |
+ movl(scratch, first); |
+ } |
+ andl(scratch, second); |
+ } |
+ testb(scratch, Immediate(kSmiTagMask)); |
return zero; |
} |