src/share/vm/compiler/disassembler.hpp

changeset 1
2d8a650513c2
parent 0
f90c822e73f8
child 433
bd82ffa08941
child 6876
710a3c8b516e
equal deleted inserted replaced
0:f90c822e73f8 1:2d8a650513c2
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 * 22 *
23 */ 23 */
24 24
25 /*
26 * This file has been modified by Loongson Technology in 2015. These
27 * modifications are Copyright (c) 2015 Loongson Technology, and are made
28 * available on the same license terms set forth above.
29 */
30
25 #ifndef SHARE_VM_COMPILER_DISASSEMBLER_HPP 31 #ifndef SHARE_VM_COMPILER_DISASSEMBLER_HPP
26 #define SHARE_VM_COMPILER_DISASSEMBLER_HPP 32 #define SHARE_VM_COMPILER_DISASSEMBLER_HPP
27 33
28 #include "asm/codeBuffer.hpp" 34 #include "asm/codeBuffer.hpp"
35 #include "compiler/disassemblerEnv.hpp"
29 #include "runtime/globals.hpp" 36 #include "runtime/globals.hpp"
30 #ifdef TARGET_OS_FAMILY_linux 37 #ifdef TARGET_OS_FAMILY_linux
31 # include "os_linux.inline.hpp" 38 # include "os_linux.inline.hpp"
32 #endif 39 #endif
33 #ifdef TARGET_OS_FAMILY_solaris 40 #ifdef TARGET_OS_FAMILY_solaris
42 #ifdef TARGET_OS_FAMILY_bsd 49 #ifdef TARGET_OS_FAMILY_bsd
43 # include "os_bsd.inline.hpp" 50 # include "os_bsd.inline.hpp"
44 #endif 51 #endif
45 52
46 class decode_env; 53 class decode_env;
47 54 #ifdef MIPS64
55 # include "disassembler_mips.hpp"
56 #else
48 // The disassembler prints out assembly code annotated 57 // The disassembler prints out assembly code annotated
49 // with Java specific information. 58 // with Java specific information.
50 59
51 class Disassembler { 60 class Disassembler {
52 friend class decode_env; 61 friend class decode_env;
74 // points to the decode function. 83 // points to the decode function.
75 static decode_func_virtual _decode_instructions_virtual; 84 static decode_func_virtual _decode_instructions_virtual;
76 static decode_func _decode_instructions; 85 static decode_func _decode_instructions;
77 // tries to load library and return whether it succedded. 86 // tries to load library and return whether it succedded.
78 static bool load_library(); 87 static bool load_library();
79 88 #ifdef MIPS64
89 // decodes one instruction and return the start of the next instruction.
90 static address decode_instruction(address start, DisassemblerEnv* env);
91 #endif
80 // Machine dependent stuff 92 // Machine dependent stuff
81 #ifdef TARGET_ARCH_x86 93 #ifdef TARGET_ARCH_x86
82 # include "disassembler_x86.hpp" 94 # include "disassembler_x86.hpp"
83 #endif 95 #endif
84 #ifdef TARGET_ARCH_sparc 96 #ifdef TARGET_ARCH_sparc
92 #endif 104 #endif
93 #ifdef TARGET_ARCH_ppc 105 #ifdef TARGET_ARCH_ppc
94 # include "disassembler_ppc.hpp" 106 # include "disassembler_ppc.hpp"
95 #endif 107 #endif
96 108
97
98 public: 109 public:
99 static bool can_decode() { 110 static bool can_decode() {
100 return (_decode_instructions_virtual != NULL) || 111 return (_decode_instructions_virtual != NULL) ||
101 (_decode_instructions != NULL) || 112 (_decode_instructions != NULL) ||
102 load_library(); 113 load_library();
104 static void decode(CodeBlob *cb, outputStream* st = NULL); 115 static void decode(CodeBlob *cb, outputStream* st = NULL);
105 static void decode(nmethod* nm, outputStream* st = NULL); 116 static void decode(nmethod* nm, outputStream* st = NULL);
106 static void decode(address begin, address end, outputStream* st = NULL, CodeStrings c = CodeStrings()); 117 static void decode(address begin, address end, outputStream* st = NULL, CodeStrings c = CodeStrings());
107 }; 118 };
108 119
120 #endif //MIPS64 has its own disassembler implements. 2013/02/25
121
109 #endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP 122 #endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP

mercurial