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

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

Issue 8687037: Very first steps for a debugger (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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/code_patcher_arm.cc ('k') | runtime/vm/code_patcher_x64.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" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 *function = call.function(); 154 *function = call.function();
155 } 155 }
156 156
157 157
158 void CodePatcher::PatchStaticCallAt(uword return_address, uword new_target) { 158 void CodePatcher::PatchStaticCallAt(uword return_address, uword new_target) {
159 StaticCall call(return_address); 159 StaticCall call(return_address);
160 call.set_target(new_target); 160 call.set_target(new_target);
161 } 161 }
162 162
163 163
164 void CodePatcher::PatchInstanceCallAt(uword return_address, uword new_target) {
165 InstanceCall call(return_address);
166 call.set_target(new_target);
167 }
168
169
164 static void SwapCode(intptr_t num_bytes, char* a, char* b) { 170 static void SwapCode(intptr_t num_bytes, char* a, char* b) {
165 for (intptr_t i = 0; i < num_bytes; i++) { 171 for (intptr_t i = 0; i < num_bytes; i++) {
166 char tmp = *a; 172 char tmp = *a;
167 *a = *b; 173 *a = *b;
168 *b = tmp; 174 *b = tmp;
169 a++; 175 a++;
170 b++; 176 b++;
171 } 177 }
172 } 178 }
173 179
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 } 266 }
261 267
262 268
263 intptr_t CodePatcher::InstanceCallSizeInBytes() { 269 intptr_t CodePatcher::InstanceCallSizeInBytes() {
264 return DartCallPattern::kNumInstructions * DartCallPattern::kInstructionSize; 270 return DartCallPattern::kNumInstructions * DartCallPattern::kInstructionSize;
265 } 271 }
266 272
267 } // namespace dart 273 } // namespace dart
268 274
269 #endif // defined TARGET_ARCH_IA32 275 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_arm.cc ('k') | runtime/vm/code_patcher_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698