| 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_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 case RawPcDescriptors::kUnoptStaticCall: | 30 case RawPcDescriptors::kUnoptStaticCall: |
| 31 stub_target = StubCode::ICCallBreakpoint_entry()->code(); | 31 stub_target = StubCode::ICCallBreakpoint_entry()->code(); |
| 32 break; | 32 break; |
| 33 case RawPcDescriptors::kRuntimeCall: | 33 case RawPcDescriptors::kRuntimeCall: |
| 34 stub_target = StubCode::RuntimeCallBreakpoint_entry()->code(); | 34 stub_target = StubCode::RuntimeCallBreakpoint_entry()->code(); |
| 35 break; | 35 break; |
| 36 default: | 36 default: |
| 37 UNREACHABLE(); | 37 UNREACHABLE(); |
| 38 } | 38 } |
| 39 const Code& code = Code::Handle(code_); | 39 const Code& code = Code::Handle(code_); |
| 40 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); | 40 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
| 41 CodePatcher::PatchPoolPointerCallAt(pc_, code, stub_target); | 41 CodePatcher::PatchPoolPointerCallAt(pc_, code, stub_target); |
| 42 is_enabled_ = true; | 42 is_enabled_ = true; |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 void CodeBreakpoint::RestoreCode() { | 46 void CodeBreakpoint::RestoreCode() { |
| 47 ASSERT(is_enabled_); | 47 ASSERT(is_enabled_); |
| 48 const Code& code = Code::Handle(code_); | 48 const Code& code = Code::Handle(code_); |
| 49 switch (breakpoint_kind_) { | 49 switch (breakpoint_kind_) { |
| 50 case RawPcDescriptors::kIcCall: | 50 case RawPcDescriptors::kIcCall: |
| 51 case RawPcDescriptors::kUnoptStaticCall: | 51 case RawPcDescriptors::kUnoptStaticCall: |
| 52 case RawPcDescriptors::kRuntimeCall: { | 52 case RawPcDescriptors::kRuntimeCall: { |
| 53 CodePatcher::PatchPoolPointerCallAt( | 53 CodePatcher::PatchPoolPointerCallAt(pc_, code, |
| 54 pc_, code, Code::Handle(saved_value_)); | 54 Code::Handle(saved_value_)); |
| 55 break; | 55 break; |
| 56 } | 56 } |
| 57 default: | 57 default: |
| 58 UNREACHABLE(); | 58 UNREACHABLE(); |
| 59 } | 59 } |
| 60 is_enabled_ = false; | 60 is_enabled_ = false; |
| 61 } | 61 } |
| 62 | 62 |
| 63 #endif // !PRODUCT | 63 #endif // !PRODUCT |
| 64 | 64 |
| 65 } // namespace dart | 65 } // namespace dart |
| 66 | 66 |
| 67 #endif // defined TARGET_ARCH_X64 | 67 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |