| OLD | NEW |
| 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
| 9 | 9 |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 | 44 |
| 45 void CodeBreakpoint::PatchCode() { | 45 void CodeBreakpoint::PatchCode() { |
| 46 ASSERT(!is_enabled_); | 46 ASSERT(!is_enabled_); |
| 47 const Code& code = Code::Handle(code_); | 47 const Code& code = Code::Handle(code_); |
| 48 const Instructions& instrs = Instructions::Handle(code.instructions()); | 48 const Instructions& instrs = Instructions::Handle(code.instructions()); |
| 49 { | 49 { |
| 50 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size()); | 50 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size()); |
| 51 switch (breakpoint_kind_) { | 51 switch (breakpoint_kind_) { |
| 52 case RawPcDescriptors::kIcCall: | 52 case RawPcDescriptors::kIcCall: |
| 53 case RawPcDescriptors::kUnoptStaticCall: | 53 case RawPcDescriptors::kUnoptStaticCall: { |
| 54 case RawPcDescriptors::kRuntimeCall: | 54 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
| 55 CodePatcher::PatchStaticCallAt( |
| 56 pc_, code, StubCode::ICCallBreakpointEntryPoint()); |
| 57 break; |
| 58 } |
| 55 case RawPcDescriptors::kClosureCall: { | 59 case RawPcDescriptors::kClosureCall: { |
| 56 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); | 60 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
| 57 CodePatcher::PatchStaticCallAt(pc_, code, | 61 CodePatcher::PatchStaticCallAt( |
| 58 StubCode::BreakpointRuntimeEntryPoint()); | 62 pc_, code, StubCode::ClosureCallBreakpointEntryPoint()); |
| 63 break; |
| 64 } |
| 65 case RawPcDescriptors::kRuntimeCall: { |
| 66 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
| 67 CodePatcher::PatchStaticCallAt( |
| 68 pc_, code, StubCode::RuntimeCallBreakpointEntryPoint()); |
| 59 break; | 69 break; |
| 60 } | 70 } |
| 61 default: | 71 default: |
| 62 UNREACHABLE(); | 72 UNREACHABLE(); |
| 63 } | 73 } |
| 64 } | 74 } |
| 65 is_enabled_ = true; | 75 is_enabled_ = true; |
| 66 } | 76 } |
| 67 | 77 |
| 68 | 78 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 83 default: | 93 default: |
| 84 UNREACHABLE(); | 94 UNREACHABLE(); |
| 85 } | 95 } |
| 86 } | 96 } |
| 87 is_enabled_ = false; | 97 is_enabled_ = false; |
| 88 } | 98 } |
| 89 | 99 |
| 90 } // namespace dart | 100 } // namespace dart |
| 91 | 101 |
| 92 #endif // defined TARGET_ARCH_IA32 | 102 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |