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

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

Issue 356923006: Iterate over PcDescriptors only via iterators, not via an index. (preparation for more compression … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 27 matching lines...) Expand all
38 } 38 }
39 39
40 40
41 void CodeBreakpoint::PatchCode() { 41 void CodeBreakpoint::PatchCode() {
42 ASSERT(!is_enabled_); 42 ASSERT(!is_enabled_);
43 const Code& code = Code::Handle(code_); 43 const Code& code = Code::Handle(code_);
44 const Instructions& instrs = Instructions::Handle(code.instructions()); 44 const Instructions& instrs = Instructions::Handle(code.instructions());
45 { 45 {
46 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size()); 46 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
47 switch (breakpoint_kind_) { 47 switch (breakpoint_kind_) {
48 case PcDescriptors::kIcCall: 48 case RawPcDescriptors::kIcCall:
49 case PcDescriptors::kUnoptStaticCall: 49 case RawPcDescriptors::kUnoptStaticCall:
50 case PcDescriptors::kRuntimeCall: 50 case RawPcDescriptors::kRuntimeCall:
51 case PcDescriptors::kClosureCall: { 51 case RawPcDescriptors::kClosureCall: {
52 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); 52 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
53 CodePatcher::PatchStaticCallAt(pc_, code, 53 CodePatcher::PatchStaticCallAt(pc_, code,
54 StubCode::BreakpointRuntimeEntryPoint()); 54 StubCode::BreakpointRuntimeEntryPoint());
55 break; 55 break;
56 } 56 }
57 default: 57 default:
58 UNREACHABLE(); 58 UNREACHABLE();
59 } 59 }
60 } 60 }
61 is_enabled_ = true; 61 is_enabled_ = true;
62 } 62 }
63 63
64 64
65 void CodeBreakpoint::RestoreCode() { 65 void CodeBreakpoint::RestoreCode() {
66 ASSERT(is_enabled_); 66 ASSERT(is_enabled_);
67 const Code& code = Code::Handle(code_); 67 const Code& code = Code::Handle(code_);
68 const Instructions& instrs = Instructions::Handle(code.instructions()); 68 const Instructions& instrs = Instructions::Handle(code.instructions());
69 { 69 {
70 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size()); 70 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
71 switch (breakpoint_kind_) { 71 switch (breakpoint_kind_) {
72 case PcDescriptors::kIcCall: 72 case RawPcDescriptors::kIcCall:
73 case PcDescriptors::kUnoptStaticCall: 73 case RawPcDescriptors::kUnoptStaticCall:
74 case PcDescriptors::kClosureCall: 74 case RawPcDescriptors::kClosureCall:
75 case PcDescriptors::kRuntimeCall: { 75 case RawPcDescriptors::kRuntimeCall: {
76 CodePatcher::PatchStaticCallAt(pc_, code, saved_value_); 76 CodePatcher::PatchStaticCallAt(pc_, code, saved_value_);
77 break; 77 break;
78 } 78 }
79 default: 79 default:
80 UNREACHABLE(); 80 UNREACHABLE();
81 } 81 }
82 } 82 }
83 is_enabled_ = false; 83 is_enabled_ = false;
84 } 84 }
85 85
86 } // namespace dart 86 } // namespace dart
87 87
88 #endif // defined TARGET_ARCH_MIPS 88 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698