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

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

Issue 339183010: Specialize breakpoint stubs by set of live registers of the stubs they are intercepting. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/debugger_mips.cc ('k') | runtime/vm/flow_graph_compiler_arm.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"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 49
50 void CodeBreakpoint::PatchCode() { 50 void CodeBreakpoint::PatchCode() {
51 ASSERT(!is_enabled_); 51 ASSERT(!is_enabled_);
52 const Code& code = Code::Handle(code_); 52 const Code& code = Code::Handle(code_);
53 const Instructions& instrs = Instructions::Handle(code.instructions()); 53 const Instructions& instrs = Instructions::Handle(code.instructions());
54 { 54 {
55 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size()); 55 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
56 switch (breakpoint_kind_) { 56 switch (breakpoint_kind_) {
57 case RawPcDescriptors::kIcCall: 57 case RawPcDescriptors::kIcCall:
58 case RawPcDescriptors::kUnoptStaticCall: 58 case RawPcDescriptors::kUnoptStaticCall: {
59 case RawPcDescriptors::kRuntimeCall: 59 int32_t offset = CodePatcher::GetPoolOffsetAt(pc_);
60 ASSERT((offset > 0) && ((offset % 8) == 7));
61 saved_value_ = static_cast<uword>(offset);
62 const uint32_t stub_offset =
63 InstructionPattern::OffsetFromPPIndex(
64 Assembler::kICCallBreakpointCPIndex);
65 CodePatcher::SetPoolOffsetAt(pc_, stub_offset);
66 break;
67 }
60 case RawPcDescriptors::kClosureCall: { 68 case RawPcDescriptors::kClosureCall: {
61 int32_t offset = CodePatcher::GetPoolOffsetAt(pc_); 69 int32_t offset = CodePatcher::GetPoolOffsetAt(pc_);
62 ASSERT((offset > 0) && ((offset % 8) == 7)); 70 ASSERT((offset > 0) && ((offset % 8) == 7));
63 saved_value_ = static_cast<uword>(offset); 71 saved_value_ = static_cast<uword>(offset);
64 const uint32_t stub_offset = 72 const uint32_t stub_offset =
65 InstructionPattern::OffsetFromPPIndex( 73 InstructionPattern::OffsetFromPPIndex(
66 Assembler::kBreakpointRuntimeCPIndex); 74 Assembler::kClosureCallBreakpointCPIndex);
67 CodePatcher::SetPoolOffsetAt(pc_, stub_offset); 75 CodePatcher::SetPoolOffsetAt(pc_, stub_offset);
68 break; 76 break;
69 } 77 }
78 case RawPcDescriptors::kRuntimeCall: {
79 int32_t offset = CodePatcher::GetPoolOffsetAt(pc_);
80 ASSERT((offset > 0) && ((offset % 8) == 7));
81 saved_value_ = static_cast<uword>(offset);
82 const uint32_t stub_offset =
83 InstructionPattern::OffsetFromPPIndex(
84 Assembler::kRuntimeCallBreakpointCPIndex);
85 CodePatcher::SetPoolOffsetAt(pc_, stub_offset);
86 break;
87 }
70 default: 88 default:
71 UNREACHABLE(); 89 UNREACHABLE();
72 } 90 }
73 } 91 }
74 is_enabled_ = true; 92 is_enabled_ = true;
75 } 93 }
76 94
77 95
78 void CodeBreakpoint::RestoreCode() { 96 void CodeBreakpoint::RestoreCode() {
79 ASSERT(is_enabled_); 97 ASSERT(is_enabled_);
(...skipping 13 matching lines...) Expand all
93 UNREACHABLE(); 111 UNREACHABLE();
94 } 112 }
95 } 113 }
96 is_enabled_ = false; 114 is_enabled_ = false;
97 } 115 }
98 116
99 117
100 } // namespace dart 118 } // namespace dart
101 119
102 #endif // defined TARGET_ARCH_X64 120 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/debugger_mips.cc ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698