Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: runtime/vm/debugger_x64.cc

Issue 1343373003: Revert "VM: New calling convention for generated code." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/debugger_mips.cc ('k') | runtime/vm/deferred_objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "vm/code_patcher.h" 11 #include "vm/code_patcher.h"
12 #include "vm/cpu.h" 12 #include "vm/cpu.h"
13 #include "vm/instructions.h" 13 #include "vm/instructions.h"
14 #include "vm/stub_code.h" 14 #include "vm/stub_code.h"
15 15
16 namespace dart { 16 namespace dart {
17 17
18 RawCode* CodeBreakpoint::OrigStubAddress() const { 18 uword CodeBreakpoint::OrigStubAddress() const {
19 return saved_value_; 19 return saved_value_;
20 } 20 }
21 21
22 22
23 void CodeBreakpoint::PatchCode() { 23 void CodeBreakpoint::PatchCode() {
24 ASSERT(!is_enabled_); 24 ASSERT(!is_enabled_);
25 Code& stub_target = Code::Handle(); 25 uword stub_target = 0;
26 switch (breakpoint_kind_) { 26 switch (breakpoint_kind_) {
27 case RawPcDescriptors::kIcCall: 27 case RawPcDescriptors::kIcCall:
28 case RawPcDescriptors::kUnoptStaticCall: 28 case RawPcDescriptors::kUnoptStaticCall:
29 stub_target = StubCode::ICCallBreakpoint_entry()->code(); 29 stub_target = StubCode::ICCallBreakpoint_entry()->EntryPoint();
30 break; 30 break;
31 case RawPcDescriptors::kRuntimeCall: 31 case RawPcDescriptors::kRuntimeCall:
32 stub_target = StubCode::RuntimeCallBreakpoint_entry()->code(); 32 stub_target = StubCode::RuntimeCallBreakpoint_entry()->EntryPoint();
33 break; 33 break;
34 default: 34 default:
35 UNREACHABLE(); 35 UNREACHABLE();
36 } 36 }
37 const Code& code = Code::Handle(code_); 37 const Code& code = Code::Handle(code_);
38 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code); 38 saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
39 CodePatcher::PatchPoolPointerCallAt(pc_, code, stub_target); 39 CodePatcher::PatchPoolPointerCallAt(pc_, code, stub_target);
40 is_enabled_ = true; 40 is_enabled_ = true;
41 } 41 }
42 42
43 43
44 void CodeBreakpoint::RestoreCode() { 44 void CodeBreakpoint::RestoreCode() {
45 ASSERT(is_enabled_); 45 ASSERT(is_enabled_);
46 const Code& code = Code::Handle(code_); 46 const Code& code = Code::Handle(code_);
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 case RawPcDescriptors::kRuntimeCall: {
51 CodePatcher::PatchPoolPointerCallAt( 51 CodePatcher::PatchPoolPointerCallAt(pc_, code, saved_value_);
52 pc_, code, Code::Handle(saved_value_));
53 break; 52 break;
54 } 53 }
55 default: 54 default:
56 UNREACHABLE(); 55 UNREACHABLE();
57 } 56 }
58 is_enabled_ = false; 57 is_enabled_ = false;
59 } 58 }
60 59
61 60
62 } // namespace dart 61 } // namespace dart
63 62
64 #endif // defined TARGET_ARCH_X64 63 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/debugger_mips.cc ('k') | runtime/vm/deferred_objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698