| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 virtual const char* NameInCode(byte* addr) const; | 60 virtual const char* NameInCode(byte* addr) const; |
| 61 Code* code() const { return code_; } | 61 Code* code() const { return code_; } |
| 62 private: | 62 private: |
| 63 Code* code_; | 63 Code* code_; |
| 64 | 64 |
| 65 EmbeddedVector<char, 128> v8_buffer_; | 65 EmbeddedVector<char, 128> v8_buffer_; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 | 68 |
| 69 const char* V8NameConverter::NameOfAddress(byte* pc) const { | 69 const char* V8NameConverter::NameOfAddress(byte* pc) const { |
| 70 const char* name = Builtins::Lookup(pc); | 70 const char* name = Isolate::Current()->builtins()->Lookup(pc); |
| 71 if (name != NULL) { | 71 if (name != NULL) { |
| 72 OS::SNPrintF(v8_buffer_, "%s (%p)", name, pc); | 72 OS::SNPrintF(v8_buffer_, "%s (%p)", name, pc); |
| 73 return v8_buffer_.start(); | 73 return v8_buffer_.start(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 if (code_ != NULL) { | 76 if (code_ != NULL) { |
| 77 int offs = static_cast<int>(pc - code_->instruction_start()); | 77 int offs = static_cast<int>(pc - code_->instruction_start()); |
| 78 // print as code offset, if it seems reasonable | 78 // print as code offset, if it seems reasonable |
| 79 if (0 <= offs && offs < code_->instruction_size()) { | 79 if (0 <= offs && offs < code_->instruction_size()) { |
| 80 OS::SNPrintF(v8_buffer_, "%d (%p)", offs, pc); | 80 OS::SNPrintF(v8_buffer_, "%d (%p)", offs, pc); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 303 |
| 304 #else // ENABLE_DISASSEMBLER | 304 #else // ENABLE_DISASSEMBLER |
| 305 | 305 |
| 306 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {} | 306 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {} |
| 307 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { return 0; } | 307 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { return 0; } |
| 308 void Disassembler::Decode(FILE* f, Code* code) {} | 308 void Disassembler::Decode(FILE* f, Code* code) {} |
| 309 | 309 |
| 310 #endif // ENABLE_DISASSEMBLER | 310 #endif // ENABLE_DISASSEMBLER |
| 311 | 311 |
| 312 } } // namespace v8::internal | 312 } } // namespace v8::internal |
| OLD | NEW |