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" |
11 #include "vm/instructions.h" | 11 #include "vm/instructions.h" |
12 #include "vm/stub_code.h" | 12 #include "vm/stub_code.h" |
13 | 13 |
14 namespace dart { | 14 namespace dart { |
15 | 15 |
16 uword CodeBreakpoint::OrigStubAddress() const { | 16 uword CodeBreakpoint::OrigStubAddress() const { |
17 return saved_value_; | 17 return saved_value_; |
18 } | 18 } |
19 | 19 |
20 | 20 |
21 void CodeBreakpoint::PatchCode() { | 21 void CodeBreakpoint::PatchCode() { |
22 ASSERT(!is_enabled_); | 22 ASSERT(!is_enabled_); |
23 StubCode* stub_code = Isolate::Current()->stub_code(); | |
24 uword stub_target = 0; | 23 uword stub_target = 0; |
25 switch (breakpoint_kind_) { | 24 switch (breakpoint_kind_) { |
26 case RawPcDescriptors::kIcCall: | 25 case RawPcDescriptors::kIcCall: |
27 case RawPcDescriptors::kUnoptStaticCall: | 26 case RawPcDescriptors::kUnoptStaticCall: |
28 stub_target = stub_code->ICCallBreakpointEntryPoint(); | 27 stub_target = StubCode::ICCallBreakpointEntryPoint(); |
29 break; | 28 break; |
30 case RawPcDescriptors::kRuntimeCall: | 29 case RawPcDescriptors::kRuntimeCall: |
31 stub_target = stub_code->RuntimeCallBreakpointEntryPoint(); | 30 stub_target = StubCode::RuntimeCallBreakpointEntryPoint(); |
32 break; | 31 break; |
33 default: | 32 default: |
34 UNREACHABLE(); | 33 UNREACHABLE(); |
35 } | 34 } |
36 const Code& code = Code::Handle(code_); | 35 const Code& code = Code::Handle(code_); |
37 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); | 36 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); |
38 CodePatcher::PatchStaticCallAt(pc_, code, stub_target); | 37 CodePatcher::PatchStaticCallAt(pc_, code, stub_target); |
39 is_enabled_ = true; | 38 is_enabled_ = true; |
40 } | 39 } |
41 | 40 |
(...skipping 10 matching lines...) Expand all Loading... |
52 } | 51 } |
53 default: | 52 default: |
54 UNREACHABLE(); | 53 UNREACHABLE(); |
55 } | 54 } |
56 is_enabled_ = false; | 55 is_enabled_ = false; |
57 } | 56 } |
58 | 57 |
59 } // namespace dart | 58 } // namespace dart |
60 | 59 |
61 #endif // defined TARGET_ARCH_MIPS | 60 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |