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 26 matching lines...) Expand all Loading... |
37 #include "string-stream.h" | 37 #include "string-stream.h" |
38 | 38 |
39 namespace v8 { | 39 namespace v8 { |
40 namespace internal { | 40 namespace internal { |
41 | 41 |
42 #ifdef ENABLE_DISASSEMBLER | 42 #ifdef ENABLE_DISASSEMBLER |
43 | 43 |
44 void Disassembler::Dump(FILE* f, byte* begin, byte* end) { | 44 void Disassembler::Dump(FILE* f, byte* begin, byte* end) { |
45 for (byte* pc = begin; pc < end; pc++) { | 45 for (byte* pc = begin; pc < end; pc++) { |
46 if (f == NULL) { | 46 if (f == NULL) { |
47 PrintF("%" V8PRIxPTR " %4" V8PRIdPTR " %02x\n", | 47 PrintF("%" V8PRIxPTR " %4" V8PRIdPTR " %02x\n", pc, pc - begin, *pc); |
48 reinterpret_cast<intptr_t>(pc), | |
49 pc - begin, | |
50 *pc); | |
51 } else { | 48 } else { |
52 fprintf(f, "%" V8PRIxPTR " %4" V8PRIdPTR " %02x\n", | 49 fprintf(f, "%" V8PRIxPTR " %4" V8PRIdPTR " %02x\n", |
53 reinterpret_cast<uintptr_t>(pc), pc - begin, *pc); | 50 reinterpret_cast<uintptr_t>(pc), pc - begin, *pc); |
54 } | 51 } |
55 } | 52 } |
56 } | 53 } |
57 | 54 |
58 | 55 |
59 class V8NameConverter: public disasm::NameConverter { | 56 class V8NameConverter: public disasm::NameConverter { |
60 public: | 57 public: |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 304 |
308 #else // ENABLE_DISASSEMBLER | 305 #else // ENABLE_DISASSEMBLER |
309 | 306 |
310 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {} | 307 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {} |
311 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { return 0; } | 308 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { return 0; } |
312 void Disassembler::Decode(FILE* f, Code* code) {} | 309 void Disassembler::Decode(FILE* f, Code* code) {} |
313 | 310 |
314 #endif // ENABLE_DISASSEMBLER | 311 #endif // ENABLE_DISASSEMBLER |
315 | 312 |
316 } } // namespace v8::internal | 313 } } // namespace v8::internal |
OLD | NEW |