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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 4733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4744 if (!*definitely_mismatches) { | 4744 if (!*definitely_mismatches) { |
4745 Branch(done); | 4745 Branch(done); |
4746 } | 4746 } |
4747 } else { | 4747 } else { |
4748 Jump(adaptor, RelocInfo::CODE_TARGET); | 4748 Jump(adaptor, RelocInfo::CODE_TARGET); |
4749 } | 4749 } |
4750 bind(®ular_invoke); | 4750 bind(®ular_invoke); |
4751 } | 4751 } |
4752 } | 4752 } |
4753 | 4753 |
4754 | 4754 void MacroAssembler::CheckDebugHook(Register fun, Register new_target, |
4755 void MacroAssembler::FloodFunctionIfStepping(Register fun, Register new_target, | 4755 const ParameterCount& expected, |
4756 const ParameterCount& expected, | 4756 const ParameterCount& actual) { |
4757 const ParameterCount& actual) { | 4757 Label skip_hook; |
4758 Label skip_flooding; | 4758 ExternalReference debug_hook_active = |
4759 ExternalReference last_step_action = | 4759 ExternalReference::debug_hook_on_function_call_address(isolate()); |
4760 ExternalReference::debug_last_step_action_address(isolate()); | 4760 li(t0, Operand(debug_hook_active)); |
4761 STATIC_ASSERT(StepFrame > StepIn); | |
4762 li(t0, Operand(last_step_action)); | |
4763 lb(t0, MemOperand(t0)); | 4761 lb(t0, MemOperand(t0)); |
4764 Branch(&skip_flooding, lt, t0, Operand(StepIn)); | 4762 Branch(&skip_hook, eq, t0, Operand(zero_reg)); |
4765 { | 4763 { |
4766 FrameScope frame(this, | 4764 FrameScope frame(this, |
4767 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); | 4765 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); |
4768 if (expected.is_reg()) { | 4766 if (expected.is_reg()) { |
4769 SmiTag(expected.reg()); | 4767 SmiTag(expected.reg()); |
4770 Push(expected.reg()); | 4768 Push(expected.reg()); |
4771 } | 4769 } |
4772 if (actual.is_reg()) { | 4770 if (actual.is_reg()) { |
4773 SmiTag(actual.reg()); | 4771 SmiTag(actual.reg()); |
4774 Push(actual.reg()); | 4772 Push(actual.reg()); |
4775 } | 4773 } |
4776 if (new_target.is_valid()) { | 4774 if (new_target.is_valid()) { |
4777 Push(new_target); | 4775 Push(new_target); |
4778 } | 4776 } |
4779 Push(fun); | 4777 Push(fun); |
4780 Push(fun); | 4778 Push(fun); |
4781 CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 4779 CallRuntime(Runtime::kDebugOnFunctionCall); |
4782 Pop(fun); | 4780 Pop(fun); |
4783 if (new_target.is_valid()) { | 4781 if (new_target.is_valid()) { |
4784 Pop(new_target); | 4782 Pop(new_target); |
4785 } | 4783 } |
4786 if (actual.is_reg()) { | 4784 if (actual.is_reg()) { |
4787 Pop(actual.reg()); | 4785 Pop(actual.reg()); |
4788 SmiUntag(actual.reg()); | 4786 SmiUntag(actual.reg()); |
4789 } | 4787 } |
4790 if (expected.is_reg()) { | 4788 if (expected.is_reg()) { |
4791 Pop(expected.reg()); | 4789 Pop(expected.reg()); |
4792 SmiUntag(expected.reg()); | 4790 SmiUntag(expected.reg()); |
4793 } | 4791 } |
4794 } | 4792 } |
4795 bind(&skip_flooding); | 4793 bind(&skip_hook); |
4796 } | 4794 } |
4797 | 4795 |
4798 | 4796 |
4799 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, | 4797 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, |
4800 const ParameterCount& expected, | 4798 const ParameterCount& expected, |
4801 const ParameterCount& actual, | 4799 const ParameterCount& actual, |
4802 InvokeFlag flag, | 4800 InvokeFlag flag, |
4803 const CallWrapper& call_wrapper) { | 4801 const CallWrapper& call_wrapper) { |
4804 // You can't call a function without a valid frame. | 4802 // You can't call a function without a valid frame. |
4805 DCHECK(flag == JUMP_FUNCTION || has_frame()); | 4803 DCHECK(flag == JUMP_FUNCTION || has_frame()); |
4806 DCHECK(function.is(a1)); | 4804 DCHECK(function.is(a1)); |
4807 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(a3)); | 4805 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(a3)); |
4808 | 4806 |
4809 if (call_wrapper.NeedsDebugStepCheck()) { | 4807 if (call_wrapper.NeedsDebugHookCheck()) { |
4810 FloodFunctionIfStepping(function, new_target, expected, actual); | 4808 CheckDebugHook(function, new_target, expected, actual); |
4811 } | 4809 } |
4812 | 4810 |
4813 // Clear the new.target register if not given. | 4811 // Clear the new.target register if not given. |
4814 if (!new_target.is_valid()) { | 4812 if (!new_target.is_valid()) { |
4815 LoadRoot(a3, Heap::kUndefinedValueRootIndex); | 4813 LoadRoot(a3, Heap::kUndefinedValueRootIndex); |
4816 } | 4814 } |
4817 | 4815 |
4818 Label done; | 4816 Label done; |
4819 bool definitely_mismatches = false; | 4817 bool definitely_mismatches = false; |
4820 InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, | 4818 InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, |
(...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6934 if (mag.shift > 0) sra(result, result, mag.shift); | 6932 if (mag.shift > 0) sra(result, result, mag.shift); |
6935 srl(at, dividend, 31); | 6933 srl(at, dividend, 31); |
6936 Addu(result, result, Operand(at)); | 6934 Addu(result, result, Operand(at)); |
6937 } | 6935 } |
6938 | 6936 |
6939 | 6937 |
6940 } // namespace internal | 6938 } // namespace internal |
6941 } // namespace v8 | 6939 } // namespace v8 |
6942 | 6940 |
6943 #endif // V8_TARGET_ARCH_MIPS64 | 6941 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |