OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 stub_target = StubCode::ICCallBreakpoint_entry()->code(); | 29 stub_target = StubCode::ICCallBreakpoint_entry()->code(); |
30 break; | 30 break; |
31 case RawPcDescriptors::kRuntimeCall: { | 31 case RawPcDescriptors::kRuntimeCall: { |
32 stub_target = StubCode::RuntimeCallBreakpoint_entry()->code(); | 32 stub_target = StubCode::RuntimeCallBreakpoint_entry()->code(); |
33 break; | 33 break; |
34 } | 34 } |
35 default: | 35 default: |
36 UNREACHABLE(); | 36 UNREACHABLE(); |
37 } | 37 } |
38 const Code& code = Code::Handle(code_); | 38 const Code& code = Code::Handle(code_); |
39 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); | 39 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
40 CodePatcher::PatchPoolPointerCallAt(pc_, code, stub_target); | 40 CodePatcher::PatchPoolPointerCallAt(pc_, code, stub_target); |
41 is_enabled_ = true; | 41 is_enabled_ = true; |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 void CodeBreakpoint::RestoreCode() { | 45 void CodeBreakpoint::RestoreCode() { |
46 ASSERT(is_enabled_); | 46 ASSERT(is_enabled_); |
47 const Code& code = Code::Handle(code_); | 47 const Code& code = Code::Handle(code_); |
48 switch (breakpoint_kind_) { | 48 switch (breakpoint_kind_) { |
49 case RawPcDescriptors::kIcCall: | 49 case RawPcDescriptors::kIcCall: |
50 case RawPcDescriptors::kUnoptStaticCall: | 50 case RawPcDescriptors::kUnoptStaticCall: |
51 case RawPcDescriptors::kRuntimeCall: { | 51 case RawPcDescriptors::kRuntimeCall: { |
52 CodePatcher::PatchPoolPointerCallAt( | 52 CodePatcher::PatchPoolPointerCallAt(pc_, code, |
53 pc_, code, Code::Handle(saved_value_)); | 53 Code::Handle(saved_value_)); |
54 break; | 54 break; |
55 } | 55 } |
56 default: | 56 default: |
57 UNREACHABLE(); | 57 UNREACHABLE(); |
58 } | 58 } |
59 is_enabled_ = false; | 59 is_enabled_ = false; |
60 } | 60 } |
61 | 61 |
62 #endif // !PRODUCT | 62 #endif // !PRODUCT |
63 | 63 |
64 } // namespace dart | 64 } // namespace dart |
65 | 65 |
66 #endif // defined TARGET_ARCH_ARM64 | 66 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |