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

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

Issue 140743010: Get rid of dynamic call debug stub (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 const intptr_t index = (offset - Array::data_offset()) / kWordSize; 44 const intptr_t index = (offset - Array::data_offset()) / kWordSize;
45 const uword stub_address = reinterpret_cast<uword>(object_pool.At(index)); 45 const uword stub_address = reinterpret_cast<uword>(object_pool.At(index));
46 ASSERT(stub_address % kWordSize == 0); 46 ASSERT(stub_address % kWordSize == 0);
47 return stub_address; 47 return stub_address;
48 } 48 }
49 49
50 50
51 void CodeBreakpoint::PatchCode() { 51 void CodeBreakpoint::PatchCode() {
52 ASSERT(!is_enabled_); 52 ASSERT(!is_enabled_);
53 switch (breakpoint_kind_) { 53 switch (breakpoint_kind_) {
54 case PcDescriptors::kIcCall: { 54 case PcDescriptors::kIcCall:
55 int32_t offset = CodePatcher::GetPoolOffsetAt(pc_);
56 ASSERT((offset > 0) && ((offset % 8) == 7));
57 saved_value_ = static_cast<uword>(offset);
58 const int32_t stub_offset =
59 InstructionPattern::OffsetFromPPIndex(
60 Assembler::kBreakpointDynamicCPIndex);
61 CodePatcher::SetPoolOffsetAt(pc_, stub_offset);
62 break;
63 }
64 case PcDescriptors::kUnoptStaticCall: 55 case PcDescriptors::kUnoptStaticCall:
65 case PcDescriptors::kRuntimeCall: 56 case PcDescriptors::kRuntimeCall:
66 case PcDescriptors::kClosureCall: 57 case PcDescriptors::kClosureCall:
67 case PcDescriptors::kReturn: { 58 case PcDescriptors::kReturn: {
68 int32_t offset = CodePatcher::GetPoolOffsetAt(pc_); 59 int32_t offset = CodePatcher::GetPoolOffsetAt(pc_);
69 ASSERT((offset > 0) && ((offset % 8) == 7)); 60 ASSERT((offset > 0) && ((offset % 8) == 7));
70 saved_value_ = static_cast<uword>(offset); 61 saved_value_ = static_cast<uword>(offset);
71 const uint32_t stub_offset = 62 const uint32_t stub_offset =
72 InstructionPattern::OffsetFromPPIndex( 63 InstructionPattern::OffsetFromPPIndex(
73 Assembler::kBreakpointRuntimeCPIndex); 64 Assembler::kBreakpointRuntimeCPIndex);
(...skipping 21 matching lines...) Expand all
95 default: 86 default:
96 UNREACHABLE(); 87 UNREACHABLE();
97 } 88 }
98 is_enabled_ = false; 89 is_enabled_ = false;
99 } 90 }
100 91
101 92
102 } // namespace dart 93 } // namespace dart
103 94
104 #endif // defined TARGET_ARCH_X64 95 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698