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

Side by Side Diff: src/disassembler.cc

Issue 1431933003: [assembler] Introduce proper AssemblerBase::Print() for improved debuggability. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/assembler.cc ('k') | src/x64/assembler-x64.h » ('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 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/disassembler.h" 5 #include "src/disassembler.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/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 14 matching lines...) Expand all
25 virtual const char* NameInCode(byte* addr) const; 25 virtual const char* NameInCode(byte* addr) const;
26 Code* code() const { return code_; } 26 Code* code() const { return code_; }
27 private: 27 private:
28 Code* code_; 28 Code* code_;
29 29
30 EmbeddedVector<char, 128> v8_buffer_; 30 EmbeddedVector<char, 128> v8_buffer_;
31 }; 31 };
32 32
33 33
34 const char* V8NameConverter::NameOfAddress(byte* pc) const { 34 const char* V8NameConverter::NameOfAddress(byte* pc) const {
35 const char* name = code_->GetIsolate()->builtins()->Lookup(pc); 35 const char* name =
36 code_ == NULL ? NULL : code_->GetIsolate()->builtins()->Lookup(pc);
37
36 if (name != NULL) { 38 if (name != NULL) {
37 SNPrintF(v8_buffer_, "%s (%p)", name, pc); 39 SNPrintF(v8_buffer_, "%s (%p)", name, pc);
38 return v8_buffer_.start(); 40 return v8_buffer_.start();
39 } 41 }
40 42
41 if (code_ != NULL) { 43 if (code_ != NULL) {
42 int offs = static_cast<int>(pc - code_->instruction_start()); 44 int offs = static_cast<int>(pc - code_->instruction_start());
43 // print as code offset, if it seems reasonable 45 // print as code offset, if it seems reasonable
44 if (0 <= offs && offs < code_->instruction_size()) { 46 if (0 <= offs && offs < code_->instruction_size()) {
45 SNPrintF(v8_buffer_, "%d (%p)", offs, pc); 47 SNPrintF(v8_buffer_, "%d (%p)", offs, pc);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 283
282 int Disassembler::Decode(Isolate* isolate, std::ostream* os, byte* begin, 284 int Disassembler::Decode(Isolate* isolate, std::ostream* os, byte* begin,
283 byte* end, Code* code) { 285 byte* end, Code* code) {
284 return 0; 286 return 0;
285 } 287 }
286 288
287 #endif // ENABLE_DISASSEMBLER 289 #endif // ENABLE_DISASSEMBLER
288 290
289 } // namespace internal 291 } // namespace internal
290 } // namespace v8 292 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698