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

Side by Side Diff: src/disassembler.cc

Issue 1188093002: Revert of Decompiler improvements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « src/compiler/code-generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug.h" 9 #include "src/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 25 matching lines...) Expand all
36 const char* name = code_->GetIsolate()->builtins()->Lookup(pc); 36 const char* name = code_->GetIsolate()->builtins()->Lookup(pc);
37 if (name != NULL) { 37 if (name != NULL) {
38 SNPrintF(v8_buffer_, "%s (%p)", name, pc); 38 SNPrintF(v8_buffer_, "%s (%p)", name, pc);
39 return v8_buffer_.start(); 39 return v8_buffer_.start();
40 } 40 }
41 41
42 if (code_ != NULL) { 42 if (code_ != NULL) {
43 int offs = static_cast<int>(pc - code_->instruction_start()); 43 int offs = static_cast<int>(pc - code_->instruction_start());
44 // print as code offset, if it seems reasonable 44 // print as code offset, if it seems reasonable
45 if (0 <= offs && offs < code_->instruction_size()) { 45 if (0 <= offs && offs < code_->instruction_size()) {
46 SNPrintF(v8_buffer_, "%x (%p)", offs, pc); 46 SNPrintF(v8_buffer_, "%d (%p)", offs, pc);
47 return v8_buffer_.start(); 47 return v8_buffer_.start();
48 } 48 }
49 } 49 }
50 50
51 return disasm::NameConverter::NameOfAddress(pc); 51 return disasm::NameConverter::NameOfAddress(pc);
52 } 52 }
53 53
54 54
55 const char* V8NameConverter::NameInCode(byte* addr) const { 55 const char* V8NameConverter::NameInCode(byte* addr) const {
56 // The V8NameConverter is used for well known code, so we can "safely" 56 // The V8NameConverter is used for well known code, so we can "safely"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 } 140 }
141 141
142 // Comments. 142 // Comments.
143 for (int i = 0; i < comments.length(); i++) { 143 for (int i = 0; i < comments.length(); i++) {
144 out.AddFormatted(" %s", comments[i]); 144 out.AddFormatted(" %s", comments[i]);
145 DumpBuffer(os, &out); 145 DumpBuffer(os, &out);
146 } 146 }
147 147
148 // Instruction address and instruction offset. 148 // Instruction address and instruction offset.
149 out.AddFormatted("%p %4x ", prev_pc, prev_pc - begin); 149 out.AddFormatted("%p %4d ", prev_pc, prev_pc - begin);
150 150
151 // Instruction. 151 // Instruction.
152 out.AddFormatted("%s", decode_buffer.start()); 152 out.AddFormatted("%s", decode_buffer.start());
153 153
154 // Print all the reloc info for this instruction which are not comments. 154 // Print all the reloc info for this instruction which are not comments.
155 for (int i = 0; i < pcs.length(); i++) { 155 for (int i = 0; i < pcs.length(); i++) {
156 // Put together the reloc info 156 // Put together the reloc info
157 RelocInfo relocinfo(pcs[i], rmodes[i], datas[i], converter.code()); 157 RelocInfo relocinfo(pcs[i], rmodes[i], datas[i], converter.code());
158 158
159 // Indent the printing of the reloc info. 159 // Indent the printing of the reloc info.
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 int Disassembler::Decode(Isolate* isolate, std::ostream* os, byte* begin, 291 int Disassembler::Decode(Isolate* isolate, std::ostream* os, byte* begin,
292 byte* end, Code* code) { 292 byte* end, Code* code) {
293 return 0; 293 return 0;
294 } 294 }
295 295
296 #endif // ENABLE_DISASSEMBLER 296 #endif // ENABLE_DISASSEMBLER
297 297
298 } // namespace internal 298 } // namespace internal
299 } // namespace v8 299 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698