< prev index next >

src/share/vm/compiler/disassembler.hpp

Print this page
rev 11647 : 8161258: Simplify including platform files.
Summary: Include patform files with macros cpu_header() etc. Do various cleanups of macro usages. Remove _64/_32 from adlc generated files and platform .hpp files. Merge stubRoutines_x86*.hpp. Remove empty mutex_<os>* files.
Reviewed-by: dholmes, coleenp, kbarrett
   1 /*
   2  * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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 #ifndef SHARE_VM_COMPILER_DISASSEMBLER_HPP
  26 #define SHARE_VM_COMPILER_DISASSEMBLER_HPP
  27 
  28 #include "asm/codeBuffer.hpp"
  29 #include "runtime/globals.hpp"

  30 
  31 class decode_env;
  32 
  33 // The disassembler prints out assembly code annotated
  34 // with Java specific information.
  35 
  36 class Disassembler {
  37   friend class decode_env;
  38  private:
  39   // this is the type of the dll entry point:
  40   typedef void* (*decode_func_virtual)(uintptr_t start_va, uintptr_t end_va,
  41                                unsigned char* buffer, uintptr_t length,
  42                                void* (*event_callback)(void*, const char*, void*),
  43                                void* event_stream,
  44                                int (*printf_callback)(void*, const char*, ...),
  45                                void* printf_stream,
  46                                const char* options,
  47                                int newline);
  48   // this is the type of the dll entry point for old version:
  49   typedef void* (*decode_func)(void* start_va, void* end_va,
  50                                void* (*event_callback)(void*, const char*, void*),
  51                                void* event_stream,
  52                                int (*printf_callback)(void*, const char*, ...),
  53                                void* printf_stream,
  54                                const char* options);
  55   // points to the library.
  56   static void*    _library;
  57   // bailout
  58   static bool     _tried_to_load_library;
  59   // points to the decode function.
  60   static decode_func_virtual _decode_instructions_virtual;
  61   static decode_func _decode_instructions;
  62   // tries to load library and return whether it succedded.
  63   static bool load_library();
  64 
  65   // Machine dependent stuff
  66 #ifdef TARGET_ARCH_x86
  67 # include "disassembler_x86.hpp"
  68 #endif
  69 #ifdef TARGET_ARCH_sparc
  70 # include "disassembler_sparc.hpp"
  71 #endif
  72 #ifdef TARGET_ARCH_zero
  73 # include "disassembler_zero.hpp"
  74 #endif
  75 #ifdef TARGET_ARCH_arm
  76 # include "disassembler_arm.hpp"
  77 #endif
  78 #ifdef TARGET_ARCH_ppc
  79 # include "disassembler_ppc.hpp"
  80 #endif
  81 #ifdef TARGET_ARCH_aarch64
  82 # include "disassembler_aarch64.hpp"
  83 #endif
  84 
  85 
  86  public:
  87   static bool can_decode() {
  88     ttyLocker tl;
  89     return (_decode_instructions_virtual != NULL) ||
  90            (_decode_instructions != NULL) ||
  91            load_library();
  92   }
  93   static void decode(CodeBlob *cb,               outputStream* st = NULL);
  94   static void decode(nmethod* nm,                outputStream* st = NULL);
  95   static void decode(address begin, address end, outputStream* st = NULL, CodeStrings c = CodeStrings());
  96 };
  97 
  98 #endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP
   1 /*
   2  * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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 #ifndef SHARE_VM_COMPILER_DISASSEMBLER_HPP
  26 #define SHARE_VM_COMPILER_DISASSEMBLER_HPP
  27 
  28 #include "asm/codeBuffer.hpp"
  29 #include "runtime/globals.hpp"
  30 #include "utilities/macros.hpp"
  31 
  32 class decode_env;
  33 
  34 // The disassembler prints out assembly code annotated
  35 // with Java specific information.
  36 
  37 class Disassembler {
  38   friend class decode_env;
  39  private:
  40   // this is the type of the dll entry point:
  41   typedef void* (*decode_func_virtual)(uintptr_t start_va, uintptr_t end_va,
  42                                unsigned char* buffer, uintptr_t length,
  43                                void* (*event_callback)(void*, const char*, void*),
  44                                void* event_stream,
  45                                int (*printf_callback)(void*, const char*, ...),
  46                                void* printf_stream,
  47                                const char* options,
  48                                int newline);
  49   // this is the type of the dll entry point for old version:
  50   typedef void* (*decode_func)(void* start_va, void* end_va,
  51                                void* (*event_callback)(void*, const char*, void*),
  52                                void* event_stream,
  53                                int (*printf_callback)(void*, const char*, ...),
  54                                void* printf_stream,
  55                                const char* options);
  56   // points to the library.
  57   static void*    _library;
  58   // bailout
  59   static bool     _tried_to_load_library;
  60   // points to the decode function.
  61   static decode_func_virtual _decode_instructions_virtual;
  62   static decode_func _decode_instructions;
  63   // tries to load library and return whether it succedded.
  64   static bool load_library();
  65 
  66   // Machine dependent stuff
  67 #include CPU_HEADER(disassembler)


















  68 
  69  public:
  70   static bool can_decode() {
  71     ttyLocker tl;
  72     return (_decode_instructions_virtual != NULL) ||
  73            (_decode_instructions != NULL) ||
  74            load_library();
  75   }
  76   static void decode(CodeBlob *cb,               outputStream* st = NULL);
  77   static void decode(nmethod* nm,                outputStream* st = NULL);
  78   static void decode(address begin, address end, outputStream* st = NULL, CodeStrings c = CodeStrings());
  79 };
  80 
  81 #endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP
< prev index next >