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

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

Issue 143263012: Ensure the debugger keeps a reference to code objects (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/debugger.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 28 matching lines...) Expand all
39 39
40 40
41 void CodeBreakpoint::PatchCode() { 41 void CodeBreakpoint::PatchCode() {
42 ASSERT(!is_enabled_); 42 ASSERT(!is_enabled_);
43 switch (breakpoint_kind_) { 43 switch (breakpoint_kind_) {
44 case PcDescriptors::kIcCall: 44 case PcDescriptors::kIcCall:
45 case PcDescriptors::kUnoptStaticCall: 45 case PcDescriptors::kUnoptStaticCall:
46 case PcDescriptors::kRuntimeCall: 46 case PcDescriptors::kRuntimeCall:
47 case PcDescriptors::kClosureCall: 47 case PcDescriptors::kClosureCall:
48 case PcDescriptors::kReturn: { 48 case PcDescriptors::kReturn: {
49 const Code& code = 49 const Code& code = Code::Handle(code_);
50 Code::Handle(Function::Handle(function_).unoptimized_code());
51 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); 50 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
52 CodePatcher::PatchStaticCallAt(pc_, code, 51 CodePatcher::PatchStaticCallAt(pc_, code,
53 StubCode::BreakpointRuntimeEntryPoint()); 52 StubCode::BreakpointRuntimeEntryPoint());
54 break; 53 break;
55 } 54 }
56 default: 55 default:
57 UNREACHABLE(); 56 UNREACHABLE();
58 } 57 }
59 is_enabled_ = true; 58 is_enabled_ = true;
60 } 59 }
61 60
62 61
63 void CodeBreakpoint::RestoreCode() { 62 void CodeBreakpoint::RestoreCode() {
64 ASSERT(is_enabled_); 63 ASSERT(is_enabled_);
65 switch (breakpoint_kind_) { 64 switch (breakpoint_kind_) {
66 case PcDescriptors::kIcCall: 65 case PcDescriptors::kIcCall:
67 case PcDescriptors::kUnoptStaticCall: 66 case PcDescriptors::kUnoptStaticCall:
68 case PcDescriptors::kClosureCall: 67 case PcDescriptors::kClosureCall:
69 case PcDescriptors::kRuntimeCall: 68 case PcDescriptors::kRuntimeCall:
70 case PcDescriptors::kReturn: { 69 case PcDescriptors::kReturn: {
71 const Code& code = 70 const Code& code = Code::Handle(code_);
72 Code::Handle(Function::Handle(function_).unoptimized_code());
73 CodePatcher::PatchStaticCallAt(pc_, code, saved_value_); 71 CodePatcher::PatchStaticCallAt(pc_, code, saved_value_);
74 break; 72 break;
75 } 73 }
76 default: 74 default:
77 UNREACHABLE(); 75 UNREACHABLE();
78 } 76 }
79 is_enabled_ = false; 77 is_enabled_ = false;
80 } 78 }
81 79
82 } // namespace dart 80 } // namespace dart
83 81
84 #endif // defined TARGET_ARCH_ARM 82 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/debugger_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698