| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_DISASSEMBLER_H_ | 5 #ifndef VM_DISASSEMBLER_H_ |
| 6 #define VM_DISASSEMBLER_H_ | 6 #define VM_DISASSEMBLER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 // Disassemble instructions. | 80 // Disassemble instructions. |
| 81 class Disassembler : public AllStatic { | 81 class Disassembler : public AllStatic { |
| 82 public: | 82 public: |
| 83 // Disassemble instructions between start and end. | 83 // Disassemble instructions between start and end. |
| 84 // (The assumption is that start is at a valid instruction). | 84 // (The assumption is that start is at a valid instruction). |
| 85 // Return true if all instructions were successfully decoded, false otherwise. | 85 // Return true if all instructions were successfully decoded, false otherwise. |
| 86 static void Disassemble(uword start, | 86 static void Disassemble(uword start, |
| 87 uword end, | 87 uword end, |
| 88 DisassemblyFormatter* formatter, | 88 DisassemblyFormatter* formatter, |
| 89 const Code::Comments& comments); | 89 const Code& code); |
| 90 | 90 |
| 91 static void Disassemble(uword start, | 91 static void Disassemble(uword start, |
| 92 uword end, | 92 uword end, |
| 93 DisassemblyFormatter* formatter) { | 93 DisassemblyFormatter* formatter) { |
| 94 Disassemble(start, end, formatter, Code::Comments::New(0)); | 94 Disassemble(start, end, formatter, Code::Handle()); |
| 95 } | 95 } |
| 96 | 96 |
| 97 static void Disassemble(uword start, | 97 static void Disassemble(uword start, |
| 98 uword end, | 98 uword end, |
| 99 const Code::Comments& comments) { | 99 const Code& code) { |
| 100 DisassembleToStdout stdout_formatter; | 100 DisassembleToStdout stdout_formatter; |
| 101 Disassemble(start, end, &stdout_formatter, comments); | 101 Disassemble(start, end, &stdout_formatter, code); |
| 102 } | 102 } |
| 103 | 103 |
| 104 static void Disassemble(uword start, uword end) { | 104 static void Disassemble(uword start, uword end) { |
| 105 DisassembleToStdout stdout_formatter; | 105 DisassembleToStdout stdout_formatter; |
| 106 Disassemble(start, end, &stdout_formatter); | 106 Disassemble(start, end, &stdout_formatter); |
| 107 } | 107 } |
| 108 | 108 |
| 109 // Disassemble instructions in a memory region. | 109 // Disassemble instructions in a memory region. |
| 110 static void DisassembleMemoryRegion(const MemoryRegion& instructions, | 110 static void DisassembleMemoryRegion(const MemoryRegion& instructions, |
| 111 DisassemblyFormatter* formatter) { | 111 DisassemblyFormatter* formatter) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 131 static bool CanFindOldObject(uword addr); | 131 static bool CanFindOldObject(uword addr); |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 static const int kHexadecimalBufferSize = 32; | 134 static const int kHexadecimalBufferSize = 32; |
| 135 static const int kUserReadableBufferSize = 256; | 135 static const int kUserReadableBufferSize = 256; |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace dart | 138 } // namespace dart |
| 139 | 139 |
| 140 #endif // VM_DISASSEMBLER_H_ | 140 #endif // VM_DISASSEMBLER_H_ |
| OLD | NEW |