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

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

Issue 10826248: Add X64 assembler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « no previous file | runtime/vm/disassembler_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/disassembler.h" 5 #include "vm/disassembler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 void DisassembleToStdout::ConsumeInstruction(char* hex_buffer, 13 void DisassembleToStdout::ConsumeInstruction(char* hex_buffer,
14 intptr_t hex_size, 14 intptr_t hex_size,
15 char* human_buffer, 15 char* human_buffer,
16 intptr_t human_size, 16 intptr_t human_size,
17 uword pc) { 17 uword pc) {
18 static const int kHexColumnWidth = 18; 18 static const int kHexColumnWidth = 23;
19 uint8_t* pc_ptr = reinterpret_cast<uint8_t*>(pc); 19 uint8_t* pc_ptr = reinterpret_cast<uint8_t*>(pc);
20 OS::Print("%p %s", pc_ptr, hex_buffer); 20 OS::Print("%p %s", pc_ptr, hex_buffer);
21 int hex_length = strlen(hex_buffer); 21 int hex_length = strlen(hex_buffer);
22 if (hex_length < kHexColumnWidth) { 22 if (hex_length < kHexColumnWidth) {
23 for (int i = kHexColumnWidth - hex_length; i > 0; i--) { 23 for (int i = kHexColumnWidth - hex_length; i > 0; i--) {
24 OS::Print(" "); 24 OS::Print(" ");
25 } 25 }
26 } 26 }
27 OS::Print("%s", human_buffer); 27 OS::Print("%s", human_buffer);
28 OS::Print("\n"); 28 OS::Print("\n");
29 } 29 }
30 30
31 31
32 void DisassembleToStdout::Print(const char* format, ...) { 32 void DisassembleToStdout::Print(const char* format, ...) {
33 va_list args; 33 va_list args;
34 va_start(args, format); 34 va_start(args, format);
35 OS::VFPrint(stdout, format, args); 35 OS::VFPrint(stdout, format, args);
36 va_end(args); 36 va_end(args);
37 } 37 }
38 38
39 } // namespace dart 39 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/disassembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698