| 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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 uword CodeBreakpoint::OrigStubAddress() const { | 36 uword CodeBreakpoint::OrigStubAddress() const { |
| 37 return saved_value_; | 37 return saved_value_; |
| 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 Isolate* isolate = Isolate::Current(); |
| 45 { | 46 { |
| 46 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size()); | 47 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size()); |
| 47 switch (breakpoint_kind_) { | 48 switch (breakpoint_kind_) { |
| 48 case RawPcDescriptors::kIcCall: | 49 case RawPcDescriptors::kIcCall: |
| 49 case RawPcDescriptors::kUnoptStaticCall: { | 50 case RawPcDescriptors::kUnoptStaticCall: { |
| 50 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); | 51 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
| 51 CodePatcher::PatchStaticCallAt( | 52 CodePatcher::PatchStaticCallAt( |
| 52 pc_, code, StubCode::ICCallBreakpointEntryPoint()); | 53 pc_, code, isolate->stub_code()->ICCallBreakpointEntryPoint()); |
| 53 break; | 54 break; |
| 54 } | 55 } |
| 55 case RawPcDescriptors::kClosureCall: { | 56 case RawPcDescriptors::kClosureCall: { |
| 56 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); | 57 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
| 57 CodePatcher::PatchStaticCallAt( | 58 CodePatcher::PatchStaticCallAt( |
| 58 pc_, code, StubCode::ClosureCallBreakpointEntryPoint()); | 59 pc_, code, isolate->stub_code()->ClosureCallBreakpointEntryPoint()); |
| 59 break; | 60 break; |
| 60 } | 61 } |
| 61 case RawPcDescriptors::kRuntimeCall: { | 62 case RawPcDescriptors::kRuntimeCall: { |
| 62 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); | 63 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
| 63 CodePatcher::PatchStaticCallAt( | 64 CodePatcher::PatchStaticCallAt( |
| 64 pc_, code, StubCode::RuntimeCallBreakpointEntryPoint()); | 65 pc_, code, isolate->stub_code()->RuntimeCallBreakpointEntryPoint()); |
| 65 break; | 66 break; |
| 66 } | 67 } |
| 67 default: | 68 default: |
| 68 UNREACHABLE(); | 69 UNREACHABLE(); |
| 69 } | 70 } |
| 70 } | 71 } |
| 71 is_enabled_ = true; | 72 is_enabled_ = true; |
| 72 } | 73 } |
| 73 | 74 |
| 74 | 75 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 89 default: | 90 default: |
| 90 UNREACHABLE(); | 91 UNREACHABLE(); |
| 91 } | 92 } |
| 92 } | 93 } |
| 93 is_enabled_ = false; | 94 is_enabled_ = false; |
| 94 } | 95 } |
| 95 | 96 |
| 96 } // namespace dart | 97 } // namespace dart |
| 97 | 98 |
| 98 #endif // defined TARGET_ARCH_MIPS | 99 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |