Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: runtime/vm/debugger_arm64.cc

Issue 1160063002: Remove unused pc descriptor types. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: added comment Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/debugger_arm.cc ('k') | runtime/vm/debugger_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "vm/instructions.h" 11 #include "vm/instructions.h"
12 #include "vm/stub_code.h" 12 #include "vm/stub_code.h"
13 13
14 namespace dart { 14 namespace dart {
15 15
16 uword CodeBreakpoint::OrigStubAddress() const { 16 uword CodeBreakpoint::OrigStubAddress() const {
17 return saved_value_; 17 return saved_value_;
18 } 18 }
19 19
20 20
21 void CodeBreakpoint::PatchCode() { 21 void CodeBreakpoint::PatchCode() {
22 ASSERT(!is_enabled_); 22 ASSERT(!is_enabled_);
23 StubCode* stub_code = Isolate::Current()->stub_code(); 23 StubCode* stub_code = Isolate::Current()->stub_code();
24 uword stub_target = 0; 24 uword stub_target = 0;
25 switch (breakpoint_kind_) { 25 switch (breakpoint_kind_) {
26 case RawPcDescriptors::kIcCall: 26 case RawPcDescriptors::kIcCall:
27 case RawPcDescriptors::kUnoptStaticCall: 27 case RawPcDescriptors::kUnoptStaticCall:
28 stub_target = stub_code->ICCallBreakpointEntryPoint(); 28 stub_target = stub_code->ICCallBreakpointEntryPoint();
29 break; 29 break;
30 case RawPcDescriptors::kClosureCall:
31 stub_target = stub_code->ClosureCallBreakpointEntryPoint();
32 break;
33 case RawPcDescriptors::kRuntimeCall: { 30 case RawPcDescriptors::kRuntimeCall: {
34 stub_target = stub_code->RuntimeCallBreakpointEntryPoint(); 31 stub_target = stub_code->RuntimeCallBreakpointEntryPoint();
35 break; 32 break;
36 } 33 }
37 default: 34 default:
38 UNREACHABLE(); 35 UNREACHABLE();
39 } 36 }
40 const Code& code = Code::Handle(code_); 37 const Code& code = Code::Handle(code_);
41 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); 38 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
42 CodePatcher::PatchPoolPointerCallAt(pc_, code, stub_target); 39 CodePatcher::PatchPoolPointerCallAt(pc_, code, stub_target);
43 is_enabled_ = true; 40 is_enabled_ = true;
44 } 41 }
45 42
46 43
47 void CodeBreakpoint::RestoreCode() { 44 void CodeBreakpoint::RestoreCode() {
48 ASSERT(is_enabled_); 45 ASSERT(is_enabled_);
49 const Code& code = Code::Handle(code_); 46 const Code& code = Code::Handle(code_);
50 switch (breakpoint_kind_) { 47 switch (breakpoint_kind_) {
51 case RawPcDescriptors::kIcCall: 48 case RawPcDescriptors::kIcCall:
52 case RawPcDescriptors::kUnoptStaticCall: 49 case RawPcDescriptors::kUnoptStaticCall:
53 case RawPcDescriptors::kClosureCall:
54 case RawPcDescriptors::kRuntimeCall: { 50 case RawPcDescriptors::kRuntimeCall: {
55 CodePatcher::PatchPoolPointerCallAt(pc_, code, saved_value_); 51 CodePatcher::PatchPoolPointerCallAt(pc_, code, saved_value_);
56 break; 52 break;
57 } 53 }
58 default: 54 default:
59 UNREACHABLE(); 55 UNREACHABLE();
60 } 56 }
61 is_enabled_ = false; 57 is_enabled_ = false;
62 } 58 }
63 59
64 } // namespace dart 60 } // namespace dart
65 61
66 #endif // defined TARGET_ARCH_ARM64 62 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/debugger_arm.cc ('k') | runtime/vm/debugger_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698