Mercurial > hg > graal-jvmci-8
comparison src/share/vm/compiler/disassembler.hpp @ 6948:e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 12 Nov 2012 23:14:12 +0100 |
parents | 3d701c802d01 |
children | a5de0cc2f91c |
comparison
equal
deleted
inserted
replaced
6711:ae13cc658b80 | 6948:e522a00b91aa |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
23 */ | 23 */ |
24 | 24 |
25 #ifndef SHARE_VM_COMPILER_DISASSEMBLER_HPP | 25 #ifndef SHARE_VM_COMPILER_DISASSEMBLER_HPP |
26 #define SHARE_VM_COMPILER_DISASSEMBLER_HPP | 26 #define SHARE_VM_COMPILER_DISASSEMBLER_HPP |
27 | 27 |
28 #include "asm/codeBuffer.hpp" | |
28 #include "runtime/globals.hpp" | 29 #include "runtime/globals.hpp" |
29 #ifdef TARGET_OS_FAMILY_linux | 30 #ifdef TARGET_OS_FAMILY_linux |
30 # include "os_linux.inline.hpp" | 31 # include "os_linux.inline.hpp" |
31 #endif | 32 #endif |
32 #ifdef TARGET_OS_FAMILY_solaris | 33 #ifdef TARGET_OS_FAMILY_solaris |
46 | 47 |
47 class Disassembler { | 48 class Disassembler { |
48 friend class decode_env; | 49 friend class decode_env; |
49 private: | 50 private: |
50 // this is the type of the dll entry point: | 51 // this is the type of the dll entry point: |
51 typedef void* (*decode_func)(void* start, void* end, | 52 typedef void* (*decode_func_virtual)(uintptr_t start_va, uintptr_t end_va, |
53 unsigned char* buffer, uintptr_t length, | |
54 void* (*event_callback)(void*, const char*, void*), | |
55 void* event_stream, | |
56 int (*printf_callback)(void*, const char*, ...), | |
57 void* printf_stream, | |
58 const char* options, | |
59 int newline); | |
60 // this is the type of the dll entry point for old version: | |
61 typedef void* (*decode_func)(void* start_va, void* end_va, | |
52 void* (*event_callback)(void*, const char*, void*), | 62 void* (*event_callback)(void*, const char*, void*), |
53 void* event_stream, | 63 void* event_stream, |
54 int (*printf_callback)(void*, const char*, ...), | 64 int (*printf_callback)(void*, const char*, ...), |
55 void* printf_stream, | 65 void* printf_stream, |
56 const char* options); | 66 const char* options); |
57 // points to the library. | 67 // points to the library. |
58 static void* _library; | 68 static void* _library; |
59 // bailout | 69 // bailout |
60 static bool _tried_to_load_library; | 70 static bool _tried_to_load_library; |
61 // points to the decode function. | 71 // points to the decode function. |
72 static decode_func_virtual _decode_instructions_virtual; | |
62 static decode_func _decode_instructions; | 73 static decode_func _decode_instructions; |
63 // tries to load library and return whether it succedded. | 74 // tries to load library and return whether it succedded. |
64 static bool load_library(); | 75 static bool load_library(); |
65 | 76 |
66 // Machine dependent stuff | 77 // Machine dependent stuff |
81 #endif | 92 #endif |
82 | 93 |
83 | 94 |
84 public: | 95 public: |
85 static bool can_decode() { | 96 static bool can_decode() { |
86 return (_decode_instructions != NULL) || load_library(); | 97 return (_decode_instructions_virtual != NULL) || |
98 (_decode_instructions != NULL) || | |
99 load_library(); | |
87 } | 100 } |
88 static void decode(CodeBlob *cb, outputStream* st = NULL); | 101 static void decode(CodeBlob *cb, outputStream* st = NULL); |
89 static void decode(nmethod* nm, outputStream* st = NULL); | 102 static void decode(nmethod* nm, outputStream* st = NULL); |
90 static void decode(address begin, address end, outputStream* st = NULL); | 103 static void decode(address begin, address end, outputStream* st = NULL, CodeComments c = CodeComments()); |
91 }; | 104 }; |
92 | 105 |
93 #endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP | 106 #endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP |