| 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_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 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 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 if (!*definitely_mismatches) { | 1751 if (!*definitely_mismatches) { |
| 1752 b(done); | 1752 b(done); |
| 1753 } | 1753 } |
| 1754 } else { | 1754 } else { |
| 1755 Jump(adaptor, RelocInfo::CODE_TARGET); | 1755 Jump(adaptor, RelocInfo::CODE_TARGET); |
| 1756 } | 1756 } |
| 1757 bind(®ular_invoke); | 1757 bind(®ular_invoke); |
| 1758 } | 1758 } |
| 1759 } | 1759 } |
| 1760 | 1760 |
| 1761 | 1761 void MacroAssembler::CheckDebugHook(Register fun, Register new_target, |
| 1762 void MacroAssembler::FloodFunctionIfStepping(Register fun, Register new_target, | 1762 const ParameterCount& expected, |
| 1763 const ParameterCount& expected, | 1763 const ParameterCount& actual) { |
| 1764 const ParameterCount& actual) { | 1764 Label skip_hook; |
| 1765 Label skip_flooding; | 1765 ExternalReference debug_hook_avtive = |
| 1766 ExternalReference last_step_action = | 1766 ExternalReference::debug_hook_on_function_call_address(isolate()); |
| 1767 ExternalReference::debug_last_step_action_address(isolate()); | 1767 mov(r4, Operand(debug_hook_avtive)); |
| 1768 STATIC_ASSERT(StepFrame > StepIn); | |
| 1769 mov(r4, Operand(last_step_action)); | |
| 1770 ldrsb(r4, MemOperand(r4)); | 1768 ldrsb(r4, MemOperand(r4)); |
| 1771 cmp(r4, Operand(StepIn)); | 1769 cmp(r4, Operand(0)); |
| 1772 b(lt, &skip_flooding); | 1770 b(eq, &skip_hook); |
| 1773 { | 1771 { |
| 1774 FrameScope frame(this, | 1772 FrameScope frame(this, |
| 1775 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); | 1773 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); |
| 1776 if (expected.is_reg()) { | 1774 if (expected.is_reg()) { |
| 1777 SmiTag(expected.reg()); | 1775 SmiTag(expected.reg()); |
| 1778 Push(expected.reg()); | 1776 Push(expected.reg()); |
| 1779 } | 1777 } |
| 1780 if (actual.is_reg()) { | 1778 if (actual.is_reg()) { |
| 1781 SmiTag(actual.reg()); | 1779 SmiTag(actual.reg()); |
| 1782 Push(actual.reg()); | 1780 Push(actual.reg()); |
| 1783 } | 1781 } |
| 1784 if (new_target.is_valid()) { | 1782 if (new_target.is_valid()) { |
| 1785 Push(new_target); | 1783 Push(new_target); |
| 1786 } | 1784 } |
| 1787 Push(fun); | 1785 Push(fun); |
| 1788 Push(fun); | 1786 Push(fun); |
| 1789 CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 1787 CallRuntime(Runtime::kDebugOnFunctionCall); |
| 1790 Pop(fun); | 1788 Pop(fun); |
| 1791 if (new_target.is_valid()) { | 1789 if (new_target.is_valid()) { |
| 1792 Pop(new_target); | 1790 Pop(new_target); |
| 1793 } | 1791 } |
| 1794 if (actual.is_reg()) { | 1792 if (actual.is_reg()) { |
| 1795 Pop(actual.reg()); | 1793 Pop(actual.reg()); |
| 1796 SmiUntag(actual.reg()); | 1794 SmiUntag(actual.reg()); |
| 1797 } | 1795 } |
| 1798 if (expected.is_reg()) { | 1796 if (expected.is_reg()) { |
| 1799 Pop(expected.reg()); | 1797 Pop(expected.reg()); |
| 1800 SmiUntag(expected.reg()); | 1798 SmiUntag(expected.reg()); |
| 1801 } | 1799 } |
| 1802 } | 1800 } |
| 1803 bind(&skip_flooding); | 1801 bind(&skip_hook); |
| 1804 } | 1802 } |
| 1805 | 1803 |
| 1806 | 1804 |
| 1807 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, | 1805 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, |
| 1808 const ParameterCount& expected, | 1806 const ParameterCount& expected, |
| 1809 const ParameterCount& actual, | 1807 const ParameterCount& actual, |
| 1810 InvokeFlag flag, | 1808 InvokeFlag flag, |
| 1811 const CallWrapper& call_wrapper) { | 1809 const CallWrapper& call_wrapper) { |
| 1812 // You can't call a function without a valid frame. | 1810 // You can't call a function without a valid frame. |
| 1813 DCHECK(flag == JUMP_FUNCTION || has_frame()); | 1811 DCHECK(flag == JUMP_FUNCTION || has_frame()); |
| 1814 DCHECK(function.is(r1)); | 1812 DCHECK(function.is(r1)); |
| 1815 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(r3)); | 1813 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(r3)); |
| 1816 | 1814 |
| 1817 if (call_wrapper.NeedsDebugStepCheck()) { | 1815 if (call_wrapper.NeedsDebugHookCheck()) { |
| 1818 FloodFunctionIfStepping(function, new_target, expected, actual); | 1816 CheckDebugHook(function, new_target, expected, actual); |
| 1819 } | 1817 } |
| 1820 | 1818 |
| 1821 // Clear the new.target register if not given. | 1819 // Clear the new.target register if not given. |
| 1822 if (!new_target.is_valid()) { | 1820 if (!new_target.is_valid()) { |
| 1823 LoadRoot(r3, Heap::kUndefinedValueRootIndex); | 1821 LoadRoot(r3, Heap::kUndefinedValueRootIndex); |
| 1824 } | 1822 } |
| 1825 | 1823 |
| 1826 Label done; | 1824 Label done; |
| 1827 bool definitely_mismatches = false; | 1825 bool definitely_mismatches = false; |
| 1828 InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, | 1826 InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, |
| (...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3872 } | 3870 } |
| 3873 } | 3871 } |
| 3874 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3872 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 3875 add(result, result, Operand(dividend, LSR, 31)); | 3873 add(result, result, Operand(dividend, LSR, 31)); |
| 3876 } | 3874 } |
| 3877 | 3875 |
| 3878 } // namespace internal | 3876 } // namespace internal |
| 3879 } // namespace v8 | 3877 } // namespace v8 |
| 3880 | 3878 |
| 3881 #endif // V8_TARGET_ARCH_ARM | 3879 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |