Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index 6128d2f81aa34fb726ca4007abdcdcde34a25ecf..11a0cc90a9e4bbcff50b111ee925864c600c793d 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -4035,64 +4035,18 @@ |
} |
-void MacroAssembler::FloodFunctionIfStepping(Register fun, Register new_target, |
- const ParameterCount& expected, |
- const ParameterCount& actual) { |
- Label skip_flooding; |
- ExternalReference debug_step_action = |
- ExternalReference::debug_last_step_action_address(isolate()); |
- li(t0, Operand(debug_step_action)); |
- lb(t0, MemOperand(t0)); |
- Branch(&skip_flooding, ne, t0, Operand(StepIn)); |
- { |
- FrameScope frame(this, |
- has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); |
- if (expected.is_reg()) { |
- SmiTag(expected.reg()); |
- Push(expected.reg()); |
- } |
- if (actual.is_reg()) { |
- SmiTag(actual.reg()); |
- Push(actual.reg()); |
- } |
- if (new_target.is_valid()) { |
- Push(new_target); |
- } |
- Push(fun); |
- Push(fun); |
- CallRuntime(Runtime::kDebugPrepareStepInIfStepping, 1); |
- Pop(fun); |
- if (new_target.is_valid()) { |
- Pop(new_target); |
- } |
- if (actual.is_reg()) { |
- Pop(actual.reg()); |
- SmiUntag(actual.reg()); |
- } |
- if (expected.is_reg()) { |
- Pop(expected.reg()); |
- SmiUntag(expected.reg()); |
- } |
- } |
- bind(&skip_flooding); |
-} |
- |
- |
-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, |
- const ParameterCount& expected, |
- const ParameterCount& actual, |
- InvokeFlag flag, |
- const CallWrapper& call_wrapper) { |
+void MacroAssembler::InvokeCode(Register code, |
+ Register new_target, |
+ const ParameterCount& expected, |
+ const ParameterCount& actual, |
+ InvokeFlag flag, |
+ const CallWrapper& call_wrapper) { |
// You can't call a function without a valid frame. |
DCHECK(flag == JUMP_FUNCTION || has_frame()); |
- DCHECK(function.is(a1)); |
+ |
+ // Ensure new target is passed in the correct register. Otherwise clear the |
+ // appropriate register in case new target is not given. |
DCHECK_IMPLIES(new_target.is_valid(), new_target.is(a3)); |
- |
- if (call_wrapper.NeedsDebugStepCheck()) { |
- FloodFunctionIfStepping(function, new_target, expected, actual); |
- } |
- |
- // Clear the new.target register if not given. |
if (!new_target.is_valid()) { |
LoadRoot(a3, Heap::kUndefinedValueRootIndex); |
} |
@@ -4102,11 +4056,6 @@ |
InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, |
call_wrapper); |
if (!definitely_mismatches) { |
- // We call indirectly through the code field in the function to |
- // allow recompilation to take effect without changing any of the |
- // call sites. |
- Register code = t0; |
- lw(code, FieldMemOperand(function, JSFunction::kCodeEntryOffset)); |
if (flag == CALL_FUNCTION) { |
call_wrapper.BeforeCall(CallSize(code)); |
Call(code); |
@@ -4133,18 +4082,18 @@ |
// Contract with called JS functions requires that function is passed in a1. |
DCHECK(function.is(a1)); |
Register expected_reg = a2; |
- Register temp_reg = t0; |
- |
- lw(temp_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
+ Register code_reg = t0; |
+ |
+ lw(code_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
lw(expected_reg, |
- FieldMemOperand(temp_reg, |
- SharedFunctionInfo::kFormalParameterCountOffset)); |
+ FieldMemOperand(code_reg, |
+ SharedFunctionInfo::kFormalParameterCountOffset)); |
sra(expected_reg, expected_reg, kSmiTagSize); |
+ lw(code_reg, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
ParameterCount expected(expected_reg); |
- InvokeFunctionCode(function, new_target, expected, actual, flag, |
- call_wrapper); |
+ InvokeCode(code_reg, new_target, expected, actual, flag, call_wrapper); |
} |
@@ -4162,7 +4111,11 @@ |
// Get the function and setup the context. |
lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
- InvokeFunctionCode(a1, no_reg, expected, actual, flag, call_wrapper); |
+ // We call indirectly through the code field in the function to |
+ // allow recompilation to take effect without changing any of the |
+ // call sites. |
+ lw(t0, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
+ InvokeCode(t0, no_reg, expected, actual, flag, call_wrapper); |
} |