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

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

Issue 23903034: - Disallow copy constructors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/coverage.cc ('k') | runtime/vm/heap_histogram.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 #include "vm/json_stream.h" 10 #include "vm/json_stream.h"
(...skipping 26 matching lines...) Expand all
37 va_end(args); 37 va_end(args);
38 } 38 }
39 39
40 40
41 void DisassembleToJSONStream::ConsumeInstruction(char* hex_buffer, 41 void DisassembleToJSONStream::ConsumeInstruction(char* hex_buffer,
42 intptr_t hex_size, 42 intptr_t hex_size,
43 char* human_buffer, 43 char* human_buffer,
44 intptr_t human_size, 44 intptr_t human_size,
45 uword pc) { 45 uword pc) {
46 uint8_t* pc_ptr = reinterpret_cast<uint8_t*>(pc); 46 uint8_t* pc_ptr = reinterpret_cast<uint8_t*>(pc);
47 JSONObject jsobj(jsarr_); 47 JSONObject jsobj(&jsarr_);
48 jsobj.AddProperty("type", "DisassembledInstruction"); 48 jsobj.AddProperty("type", "DisassembledInstruction");
49 jsobj.AddPropertyF("pc", "%p", pc_ptr); 49 jsobj.AddPropertyF("pc", "%p", pc_ptr);
50 jsobj.AddProperty("hex", hex_buffer); 50 jsobj.AddProperty("hex", hex_buffer);
51 jsobj.AddProperty("human", human_buffer); 51 jsobj.AddProperty("human", human_buffer);
52 } 52 }
53 53
54 54
55 void DisassembleToJSONStream::Print(const char* format, ...) { 55 void DisassembleToJSONStream::Print(const char* format, ...) {
56 va_list args; 56 va_list args;
57 va_start(args, format); 57 va_start(args, format);
58 intptr_t len = OS::VSNPrint(NULL, 0, format, args); 58 intptr_t len = OS::VSNPrint(NULL, 0, format, args);
59 va_end(args); 59 va_end(args);
60 char* p = reinterpret_cast<char*>(malloc(len+1)); 60 char* p = reinterpret_cast<char*>(malloc(len+1));
61 va_start(args, format); 61 va_start(args, format);
62 intptr_t len2 = OS::VSNPrint(p, len, format, args); 62 intptr_t len2 = OS::VSNPrint(p, len, format, args);
63 va_end(args); 63 va_end(args);
64 ASSERT(len == len2); 64 ASSERT(len == len2);
65 for (intptr_t i = 0; i < len; i++) { 65 for (intptr_t i = 0; i < len; i++) {
66 if (p[i] == '\n' || p[i] == '\r') { 66 if (p[i] == '\n' || p[i] == '\r') {
67 p[i] = ' '; 67 p[i] = ' ';
68 } 68 }
69 } 69 }
70 JSONObject jsobj(jsarr_); 70 JSONObject jsobj(&jsarr_);
71 jsobj.AddProperty("type", "DisassembledInstructionComment"); 71 jsobj.AddProperty("type", "DisassembledInstructionComment");
72 jsobj.AddProperty("comment", p); 72 jsobj.AddProperty("comment", p);
73 free(p); 73 free(p);
74 } 74 }
75 75
76 } // namespace dart 76 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/coverage.cc ('k') | runtime/vm/heap_histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698