| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 6 | 6 |
| 7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 // Store resume mode into generator object. | 743 // Store resume mode into generator object. |
| 744 __ Str(x2, FieldMemOperand(x1, JSGeneratorObject::kResumeModeOffset)); | 744 __ Str(x2, FieldMemOperand(x1, JSGeneratorObject::kResumeModeOffset)); |
| 745 | 745 |
| 746 // Load suspended function and context. | 746 // Load suspended function and context. |
| 747 __ Ldr(cp, FieldMemOperand(x1, JSGeneratorObject::kContextOffset)); | 747 __ Ldr(cp, FieldMemOperand(x1, JSGeneratorObject::kContextOffset)); |
| 748 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); | 748 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); |
| 749 | 749 |
| 750 // Flood function if we are stepping. | 750 // Flood function if we are stepping. |
| 751 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; | 751 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; |
| 752 Label stepping_prepared; | 752 Label stepping_prepared; |
| 753 ExternalReference last_step_action = | 753 ExternalReference debug_hook = |
| 754 ExternalReference::debug_last_step_action_address(masm->isolate()); | 754 ExternalReference::debug_hook_on_function_call_address(masm->isolate()); |
| 755 STATIC_ASSERT(StepFrame > StepIn); | 755 __ Mov(x10, Operand(debug_hook)); |
| 756 __ Mov(x10, Operand(last_step_action)); | |
| 757 __ Ldrsb(x10, MemOperand(x10)); | 756 __ Ldrsb(x10, MemOperand(x10)); |
| 758 __ CompareAndBranch(x10, Operand(StepIn), ge, &prepare_step_in_if_stepping); | 757 __ CompareAndBranch(x10, Operand(0), ne, &prepare_step_in_if_stepping); |
| 759 | 758 |
| 760 // Flood function if we need to continue stepping in the suspended generator. | 759 // Flood function if we need to continue stepping in the suspended generator. |
| 761 ExternalReference debug_suspended_generator = | 760 ExternalReference debug_suspended_generator = |
| 762 ExternalReference::debug_suspended_generator_address(masm->isolate()); | 761 ExternalReference::debug_suspended_generator_address(masm->isolate()); |
| 763 __ Mov(x10, Operand(debug_suspended_generator)); | 762 __ Mov(x10, Operand(debug_suspended_generator)); |
| 764 __ Ldr(x10, MemOperand(x10)); | 763 __ Ldr(x10, MemOperand(x10)); |
| 765 __ CompareAndBranch(x10, Operand(x1), eq, | 764 __ CompareAndBranch(x10, Operand(x1), eq, |
| 766 &prepare_step_in_suspended_generator); | 765 &prepare_step_in_suspended_generator); |
| 767 __ Bind(&stepping_prepared); | 766 __ Bind(&stepping_prepared); |
| 768 | 767 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 __ Move(x3, x1); | 807 __ Move(x3, x1); |
| 809 __ Move(x1, x4); | 808 __ Move(x1, x4); |
| 810 __ Ldr(x5, FieldMemOperand(x1, JSFunction::kCodeEntryOffset)); | 809 __ Ldr(x5, FieldMemOperand(x1, JSFunction::kCodeEntryOffset)); |
| 811 __ Jump(x5); | 810 __ Jump(x5); |
| 812 } | 811 } |
| 813 | 812 |
| 814 __ Bind(&prepare_step_in_if_stepping); | 813 __ Bind(&prepare_step_in_if_stepping); |
| 815 { | 814 { |
| 816 FrameScope scope(masm, StackFrame::INTERNAL); | 815 FrameScope scope(masm, StackFrame::INTERNAL); |
| 817 __ Push(x1, x2, x4); | 816 __ Push(x1, x2, x4); |
| 818 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 817 __ CallRuntime(Runtime::kDebugOnFunctionCall); |
| 819 __ Pop(x2, x1); | 818 __ Pop(x2, x1); |
| 820 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); | 819 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); |
| 821 } | 820 } |
| 822 __ B(&stepping_prepared); | 821 __ B(&stepping_prepared); |
| 823 | 822 |
| 824 __ Bind(&prepare_step_in_suspended_generator); | 823 __ Bind(&prepare_step_in_suspended_generator); |
| 825 { | 824 { |
| 826 FrameScope scope(masm, StackFrame::INTERNAL); | 825 FrameScope scope(masm, StackFrame::INTERNAL); |
| 827 __ Push(x1, x2); | 826 __ Push(x1, x2); |
| 828 __ CallRuntime(Runtime::kDebugPrepareStepInSuspendedGenerator); | 827 __ CallRuntime(Runtime::kDebugPrepareStepInSuspendedGenerator); |
| (...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2998 __ Unreachable(); | 2997 __ Unreachable(); |
| 2999 } | 2998 } |
| 3000 } | 2999 } |
| 3001 | 3000 |
| 3002 #undef __ | 3001 #undef __ |
| 3003 | 3002 |
| 3004 } // namespace internal | 3003 } // namespace internal |
| 3005 } // namespace v8 | 3004 } // namespace v8 |
| 3006 | 3005 |
| 3007 #endif // V8_TARGET_ARCH_ARM | 3006 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |