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

Side by Side Diff: src/disassembler.cc

Issue 2804005: [Isolates] Removal of miscellaneous statics from the backend. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « src/disasm.h ('k') | src/ia32/disasm-ia32.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 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 55
56 class V8NameConverter: public disasm::NameConverter { 56 class V8NameConverter: public disasm::NameConverter {
57 public: 57 public:
58 explicit V8NameConverter(Code* code) : code_(code) {} 58 explicit V8NameConverter(Code* code) : code_(code) {}
59 virtual const char* NameOfAddress(byte* pc) const; 59 virtual const char* NameOfAddress(byte* pc) const;
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
65 EmbeddedVector<char, 128> v8_buffer_;
64 }; 66 };
65 67
66 68
67 const char* V8NameConverter::NameOfAddress(byte* pc) const { 69 const char* V8NameConverter::NameOfAddress(byte* pc) const {
68 static v8::internal::EmbeddedVector<char, 128> buffer;
69
70 const char* name = Builtins::Lookup(pc); 70 const char* name = Builtins::Lookup(pc);
71 if (name != NULL) { 71 if (name != NULL) {
72 OS::SNPrintF(buffer, "%s (%p)", name, pc); 72 OS::SNPrintF(v8_buffer_, "%s (%p)", name, pc);
73 return 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(buffer, "%d (%p)", offs, pc); 80 OS::SNPrintF(v8_buffer_, "%d (%p)", offs, pc);
81 return buffer.start(); 81 return v8_buffer_.start();
82 } 82 }
83 } 83 }
84 84
85 return disasm::NameConverter::NameOfAddress(pc); 85 return disasm::NameConverter::NameOfAddress(pc);
86 } 86 }
87 87
88 88
89 const char* V8NameConverter::NameInCode(byte* addr) const { 89 const char* V8NameConverter::NameInCode(byte* addr) const {
90 // The V8NameConverter is used for well known code, so we can "safely" 90 // The V8NameConverter is used for well known code, so we can "safely"
91 // dereference pointers in generated code. 91 // dereference pointers in generated code.
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « src/disasm.h ('k') | src/ia32/disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698