OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |