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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_disassembler.cpp.incl" 27 28 void* Disassembler::_library = NULL; 29 bool Disassembler::_tried_to_load_library = false; 30 31 // This routine is in the shared library: 32 Disassembler::decode_func Disassembler::_decode_instructions = NULL; 33 34 static const char hsdis_library_name[] = "hsdis-"HOTSPOT_LIB_ARCH; 35 static const char decode_instructions_name[] = "decode_instructions"; 36 37 #define COMMENT_COLUMN 40 LP64_ONLY(+8) /*could be an option*/ 38 #define BYTES_COMMENT ";..." /* funky byte display comment */ 39 40 bool Disassembler::load_library() { 41 if (_decode_instructions != NULL) { 42 // Already succeeded. 43 return true; 44 } 45 if (_tried_to_load_library) { 46 // Do not try twice. | 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "classfile/javaClasses.hpp" 27 #include "code/codeCache.hpp" 28 #include "compiler/disassembler.hpp" 29 #include "gc_interface/collectedHeap.hpp" 30 #include "memory/cardTableModRefBS.hpp" 31 #include "runtime/fprofiler.hpp" 32 #include "runtime/handles.inline.hpp" 33 #include "runtime/hpi.hpp" 34 #include "runtime/stubCodeGenerator.hpp" 35 #include "runtime/stubRoutines.hpp" 36 #ifdef TARGET_ARCH_x86 37 # include "depChecker_x86.hpp" 38 #endif 39 #ifdef TARGET_ARCH_sparc 40 # include "depChecker_sparc.hpp" 41 #endif 42 #ifdef TARGET_ARCH_zero 43 # include "depChecker_zero.hpp" 44 #endif 45 #ifdef SHARK 46 #include "shark/sharkEntry.hpp" 47 #endif 48 49 void* Disassembler::_library = NULL; 50 bool Disassembler::_tried_to_load_library = false; 51 52 // This routine is in the shared library: 53 Disassembler::decode_func Disassembler::_decode_instructions = NULL; 54 55 static const char hsdis_library_name[] = "hsdis-"HOTSPOT_LIB_ARCH; 56 static const char decode_instructions_name[] = "decode_instructions"; 57 58 #define COMMENT_COLUMN 40 LP64_ONLY(+8) /*could be an option*/ 59 #define BYTES_COMMENT ";..." /* funky byte display comment */ 60 61 bool Disassembler::load_library() { 62 if (_decode_instructions != NULL) { 63 // Already succeeded. 64 return true; 65 } 66 if (_tried_to_load_library) { 67 // Do not try twice. |