src/share/vm/compiler/disassembler.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/compiler

src/share/vm/compiler/disassembler.hpp

Print this page
rev 10077 : 8148696: Race loading hsdis may cause SIGSEGV
Summary: Guard library loading with a lock
Reviewed-by:


  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     return (_decode_instructions_virtual != NULL) ||
  89            (_decode_instructions != NULL) ||
  90            load_library();
  91   }
  92   static void decode(CodeBlob *cb,               outputStream* st = NULL);
  93   static void decode(nmethod* nm,                outputStream* st = NULL);
  94   static void decode(address begin, address end, outputStream* st = NULL, CodeStrings c = CodeStrings());
  95 };
  96 
  97 #endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP


  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 succeeded.
  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   static void decode(CodeBlob *cb,               outputStream* st = NULL);
  89   static void decode(nmethod* nm,                outputStream* st = NULL);
  90   static void decode(address begin, address end, outputStream* st = NULL, CodeStrings c = CodeStrings());
  91 };
  92 
  93 #endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP
src/share/vm/compiler/disassembler.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File