Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 884cbab0efb62ad660e1fb749566406b2ff595f4..e3ab7c7e3d30361e4074893025414db87c229767 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -3632,10 +3632,10 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, |
Label invoke; |
if (expected.is_immediate()) { |
DCHECK(actual.is_immediate()); |
+ Set(rax, actual.immediate()); |
if (expected.immediate() == actual.immediate()) { |
definitely_matches = true; |
} else { |
- Set(rax, actual.immediate()); |
if (expected.immediate() == |
SharedFunctionInfo::kDontAdaptArgumentsSentinel) { |
// Don't worry about adapting arguments for built-ins that |
@@ -3653,10 +3653,10 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, |
// Expected is in register, actual is immediate. This is the |
// case when we invoke function values without going through the |
// IC mechanism. |
+ Set(rax, actual.immediate()); |
cmpp(expected.reg(), Immediate(actual.immediate())); |
j(equal, &invoke, Label::kNear); |
DCHECK(expected.reg().is(rbx)); |
- Set(rax, actual.immediate()); |
} else if (!expected.reg().is(actual.reg())) { |
// Both expected and actual are in (different) registers. This |
// is the case when we invoke functions using call and apply. |
@@ -3664,6 +3664,8 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, |
j(equal, &invoke, Label::kNear); |
DCHECK(actual.reg().is(rax)); |
DCHECK(expected.reg().is(rbx)); |
+ } else { |
+ Move(rax, actual.reg()); |
} |
} |