| Index: src/mips/macro-assembler-mips.cc
|
| diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc
|
| index 56930699e5d8628db22b23cf1f9ff41bb7998865..22557357f4a28ae14045913b94690b9725196b6f 100644
|
| --- a/src/mips/macro-assembler-mips.cc
|
| +++ b/src/mips/macro-assembler-mips.cc
|
| @@ -3430,10 +3430,12 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
|
| Handle<Code> code_constant,
|
| Register code_reg,
|
| Label* done,
|
| + bool* definitely_mismatches,
|
| InvokeFlag flag,
|
| const CallWrapper& call_wrapper,
|
| CallKind call_kind) {
|
| bool definitely_matches = false;
|
| + *definitely_mismatches = false;
|
| Label regular_invoke;
|
|
|
| // Check whether the expected and actual arguments count match. If not,
|
| @@ -3464,6 +3466,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
|
| // arguments.
|
| definitely_matches = true;
|
| } else {
|
| + *definitely_mismatches = true;
|
| li(a2, Operand(expected.immediate()));
|
| }
|
| }
|
| @@ -3487,7 +3490,9 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
|
| SetCallKind(t1, call_kind);
|
| Call(adaptor);
|
| call_wrapper.AfterCall();
|
| - jmp(done);
|
| + if (!*definitely_mismatches) {
|
| + Branch(done);
|
| + }
|
| } else {
|
| SetCallKind(t1, call_kind);
|
| Jump(adaptor, RelocInfo::CODE_TARGET);
|
| @@ -3508,21 +3513,25 @@ void MacroAssembler::InvokeCode(Register code,
|
|
|
| Label done;
|
|
|
| - InvokePrologue(expected, actual, Handle<Code>::null(), code, &done, flag,
|
| + bool definitely_mismatches = false;
|
| + InvokePrologue(expected, actual, Handle<Code>::null(), code,
|
| + &done, &definitely_mismatches, flag,
|
| call_wrapper, call_kind);
|
| - if (flag == CALL_FUNCTION) {
|
| - call_wrapper.BeforeCall(CallSize(code));
|
| - SetCallKind(t1, call_kind);
|
| - Call(code);
|
| - call_wrapper.AfterCall();
|
| - } else {
|
| - ASSERT(flag == JUMP_FUNCTION);
|
| - SetCallKind(t1, call_kind);
|
| - Jump(code);
|
| + if (!definitely_mismatches) {
|
| + if (flag == CALL_FUNCTION) {
|
| + call_wrapper.BeforeCall(CallSize(code));
|
| + SetCallKind(t1, call_kind);
|
| + Call(code);
|
| + call_wrapper.AfterCall();
|
| + } else {
|
| + ASSERT(flag == JUMP_FUNCTION);
|
| + SetCallKind(t1, call_kind);
|
| + Jump(code);
|
| + }
|
| + // Continue here if InvokePrologue does handle the invocation due to
|
| + // mismatched parameter counts.
|
| + bind(&done);
|
| }
|
| - // Continue here if InvokePrologue does handle the invocation due to
|
| - // mismatched parameter counts.
|
| - bind(&done);
|
| }
|
|
|
|
|
| @@ -3537,18 +3546,22 @@ void MacroAssembler::InvokeCode(Handle<Code> code,
|
|
|
| Label done;
|
|
|
| - InvokePrologue(expected, actual, code, no_reg, &done, flag,
|
| + bool definitely_mismatches = false;
|
| + InvokePrologue(expected, actual, code, no_reg,
|
| + &done, &definitely_mismatches, flag,
|
| NullCallWrapper(), call_kind);
|
| - if (flag == CALL_FUNCTION) {
|
| - SetCallKind(t1, call_kind);
|
| - Call(code, rmode);
|
| - } else {
|
| - SetCallKind(t1, call_kind);
|
| - Jump(code, rmode);
|
| + if (!definitely_mismatches) {
|
| + if (flag == CALL_FUNCTION) {
|
| + SetCallKind(t1, call_kind);
|
| + Call(code, rmode);
|
| + } else {
|
| + SetCallKind(t1, call_kind);
|
| + Jump(code, rmode);
|
| + }
|
| + // Continue here if InvokePrologue does handle the invocation due to
|
| + // mismatched parameter counts.
|
| + bind(&done);
|
| }
|
| - // Continue here if InvokePrologue does handle the invocation due to
|
| - // mismatched parameter counts.
|
| - bind(&done);
|
| }
|
|
|
|
|
| @@ -3581,6 +3594,7 @@ void MacroAssembler::InvokeFunction(Register function,
|
| void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
|
| const ParameterCount& actual,
|
| InvokeFlag flag,
|
| + const CallWrapper& call_wrapper,
|
| CallKind call_kind) {
|
| // You can't call a function without a valid frame.
|
| ASSERT(flag == JUMP_FUNCTION || has_frame());
|
| @@ -3594,7 +3608,7 @@ void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
|
| // allow recompilation to take effect without changing any of the
|
| // call sites.
|
| lw(a3, FieldMemOperand(a1, JSFunction::kCodeEntryOffset));
|
| - InvokeCode(a3, expected, actual, flag, NullCallWrapper(), call_kind);
|
| + InvokeCode(a3, expected, actual, flag, call_wrapper, call_kind);
|
| }
|
|
|
|
|
|
|