OLD | NEW |
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 28 matching lines...) Expand all Loading... |
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 RawPcDescriptors::kIcCall: | 48 case RawPcDescriptors::kIcCall: |
49 case RawPcDescriptors::kUnoptStaticCall: | 49 case RawPcDescriptors::kUnoptStaticCall: { |
50 case RawPcDescriptors::kRuntimeCall: | 50 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
| 51 CodePatcher::PatchStaticCallAt( |
| 52 pc_, code, StubCode::ICCallBreakpointEntryPoint()); |
| 53 break; |
| 54 } |
51 case RawPcDescriptors::kClosureCall: { | 55 case RawPcDescriptors::kClosureCall: { |
52 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); | 56 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
53 CodePatcher::PatchStaticCallAt(pc_, code, | 57 CodePatcher::PatchStaticCallAt( |
54 StubCode::BreakpointRuntimeEntryPoint()); | 58 pc_, code, StubCode::ClosureCallBreakpointEntryPoint()); |
| 59 break; |
| 60 } |
| 61 case RawPcDescriptors::kRuntimeCall: { |
| 62 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
| 63 CodePatcher::PatchStaticCallAt( |
| 64 pc_, code, StubCode::RuntimeCallBreakpointEntryPoint()); |
55 break; | 65 break; |
56 } | 66 } |
57 default: | 67 default: |
58 UNREACHABLE(); | 68 UNREACHABLE(); |
59 } | 69 } |
60 } | 70 } |
61 is_enabled_ = true; | 71 is_enabled_ = true; |
62 } | 72 } |
63 | 73 |
64 | 74 |
(...skipping 14 matching lines...) Expand all Loading... |
79 default: | 89 default: |
80 UNREACHABLE(); | 90 UNREACHABLE(); |
81 } | 91 } |
82 } | 92 } |
83 is_enabled_ = false; | 93 is_enabled_ = false; |
84 } | 94 } |
85 | 95 |
86 } // namespace dart | 96 } // namespace dart |
87 | 97 |
88 #endif // defined TARGET_ARCH_MIPS | 98 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |