OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 4540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4551 if (!*definitely_mismatches) { | 4551 if (!*definitely_mismatches) { |
4552 Branch(done); | 4552 Branch(done); |
4553 } | 4553 } |
4554 } else { | 4554 } else { |
4555 Jump(adaptor, RelocInfo::CODE_TARGET); | 4555 Jump(adaptor, RelocInfo::CODE_TARGET); |
4556 } | 4556 } |
4557 bind(®ular_invoke); | 4557 bind(®ular_invoke); |
4558 } | 4558 } |
4559 } | 4559 } |
4560 | 4560 |
4561 | 4561 void MacroAssembler::CheckDebugHook(Register fun, Register new_target, |
4562 void MacroAssembler::FloodFunctionIfStepping(Register fun, Register new_target, | 4562 const ParameterCount& expected, |
4563 const ParameterCount& expected, | 4563 const ParameterCount& actual) { |
4564 const ParameterCount& actual) { | 4564 Label skip_hook; |
4565 Label skip_flooding; | 4565 ExternalReference debug_hook_active = |
4566 ExternalReference last_step_action = | 4566 ExternalReference::debug_hook_on_function_call_address(isolate()); |
4567 ExternalReference::debug_last_step_action_address(isolate()); | 4567 li(t0, Operand(debug_hook_active)); |
4568 STATIC_ASSERT(StepFrame > StepIn); | |
4569 li(t0, Operand(last_step_action)); | |
4570 lb(t0, MemOperand(t0)); | 4568 lb(t0, MemOperand(t0)); |
4571 Branch(&skip_flooding, lt, t0, Operand(StepIn)); | 4569 Branch(&skip_hook, eq, t0, Operand(zero_reg)); |
4572 { | 4570 { |
4573 FrameScope frame(this, | 4571 FrameScope frame(this, |
4574 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); | 4572 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); |
4575 if (expected.is_reg()) { | 4573 if (expected.is_reg()) { |
4576 SmiTag(expected.reg()); | 4574 SmiTag(expected.reg()); |
4577 Push(expected.reg()); | 4575 Push(expected.reg()); |
4578 } | 4576 } |
4579 if (actual.is_reg()) { | 4577 if (actual.is_reg()) { |
4580 SmiTag(actual.reg()); | 4578 SmiTag(actual.reg()); |
4581 Push(actual.reg()); | 4579 Push(actual.reg()); |
4582 } | 4580 } |
4583 if (new_target.is_valid()) { | 4581 if (new_target.is_valid()) { |
4584 Push(new_target); | 4582 Push(new_target); |
4585 } | 4583 } |
4586 Push(fun); | 4584 Push(fun); |
4587 Push(fun); | 4585 Push(fun); |
4588 CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 4586 CallRuntime(Runtime::kDebugOnFunctionCall); |
4589 Pop(fun); | 4587 Pop(fun); |
4590 if (new_target.is_valid()) { | 4588 if (new_target.is_valid()) { |
4591 Pop(new_target); | 4589 Pop(new_target); |
4592 } | 4590 } |
4593 if (actual.is_reg()) { | 4591 if (actual.is_reg()) { |
4594 Pop(actual.reg()); | 4592 Pop(actual.reg()); |
4595 SmiUntag(actual.reg()); | 4593 SmiUntag(actual.reg()); |
4596 } | 4594 } |
4597 if (expected.is_reg()) { | 4595 if (expected.is_reg()) { |
4598 Pop(expected.reg()); | 4596 Pop(expected.reg()); |
4599 SmiUntag(expected.reg()); | 4597 SmiUntag(expected.reg()); |
4600 } | 4598 } |
4601 } | 4599 } |
4602 bind(&skip_flooding); | 4600 bind(&skip_hook); |
4603 } | 4601 } |
4604 | 4602 |
4605 | 4603 |
4606 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, | 4604 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, |
4607 const ParameterCount& expected, | 4605 const ParameterCount& expected, |
4608 const ParameterCount& actual, | 4606 const ParameterCount& actual, |
4609 InvokeFlag flag, | 4607 InvokeFlag flag, |
4610 const CallWrapper& call_wrapper) { | 4608 const CallWrapper& call_wrapper) { |
4611 // You can't call a function without a valid frame. | 4609 // You can't call a function without a valid frame. |
4612 DCHECK(flag == JUMP_FUNCTION || has_frame()); | 4610 DCHECK(flag == JUMP_FUNCTION || has_frame()); |
4613 DCHECK(function.is(a1)); | 4611 DCHECK(function.is(a1)); |
4614 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(a3)); | 4612 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(a3)); |
4615 | 4613 |
4616 if (call_wrapper.NeedsDebugStepCheck()) { | 4614 if (call_wrapper.NeedsDebugHookCheck()) { |
4617 FloodFunctionIfStepping(function, new_target, expected, actual); | 4615 CheckDebugHook(function, new_target, expected, actual); |
4618 } | 4616 } |
4619 | 4617 |
4620 // Clear the new.target register if not given. | 4618 // Clear the new.target register if not given. |
4621 if (!new_target.is_valid()) { | 4619 if (!new_target.is_valid()) { |
4622 LoadRoot(a3, Heap::kUndefinedValueRootIndex); | 4620 LoadRoot(a3, Heap::kUndefinedValueRootIndex); |
4623 } | 4621 } |
4624 | 4622 |
4625 Label done; | 4623 Label done; |
4626 bool definitely_mismatches = false; | 4624 bool definitely_mismatches = false; |
4627 InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, | 4625 InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, |
(...skipping 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6528 if (mag.shift > 0) sra(result, result, mag.shift); | 6526 if (mag.shift > 0) sra(result, result, mag.shift); |
6529 srl(at, dividend, 31); | 6527 srl(at, dividend, 31); |
6530 Addu(result, result, Operand(at)); | 6528 Addu(result, result, Operand(at)); |
6531 } | 6529 } |
6532 | 6530 |
6533 | 6531 |
6534 } // namespace internal | 6532 } // namespace internal |
6535 } // namespace v8 | 6533 } // namespace v8 |
6536 | 6534 |
6537 #endif // V8_TARGET_ARCH_MIPS | 6535 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |