< prev index next >

src/share/vm/runtime/interfaceSupport.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


  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_RUNTIME_INTERFACESUPPORT_HPP
  26 #define SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP
  27 
  28 #include "gc/shared/gcLocker.hpp"
  29 #include "runtime/handles.inline.hpp"
  30 #include "runtime/mutexLocker.hpp"
  31 #include "runtime/orderAccess.hpp"
  32 #include "runtime/os.hpp"
  33 #include "runtime/safepoint.hpp"
  34 #include "runtime/thread.inline.hpp"
  35 #include "runtime/vmThread.hpp"
  36 #include "utilities/globalDefinitions.hpp"

  37 #include "utilities/preserveException.hpp"
  38 
  39 // Wrapper for all entry points to the virtual machine.
  40 // The HandleMarkCleaner is a faster version of HandleMark.
  41 // It relies on the fact that there is a HandleMark further
  42 // down the stack (in JavaCalls::call_helper), and just resets
  43 // to the saved values in that HandleMark.
  44 
  45 class HandleMarkCleaner: public StackObj {
  46  private:
  47   Thread* _thread;
  48  public:
  49   HandleMarkCleaner(Thread* thread) {
  50     _thread = thread;
  51     _thread->last_handle_mark()->push();
  52   }
  53   ~HandleMarkCleaner() {
  54     _thread->last_handle_mark()->pop_and_restore();
  55   }
  56 


  73   static long _number_of_calls;
  74   static long _fullgc_alot_invocation;
  75 
  76   // Helper methods used to implement +ScavengeALot and +FullGCALot
  77   static void check_gc_alot() { if (ScavengeALot || FullGCALot) gc_alot(); }
  78   static void gc_alot();
  79 
  80   static void walk_stack_from(vframe* start_vf);
  81   static void walk_stack();
  82 
  83   static void zombieAll();
  84   static void unlinkSymbols();
  85   static void deoptimizeAll();
  86   static void stress_derived_pointers();
  87   static void verify_stack();
  88   static void verify_last_frame();
  89 # endif
  90 
  91  public:
  92   // OS dependent stuff
  93 #ifdef TARGET_OS_FAMILY_linux
  94 # include "interfaceSupport_linux.hpp"
  95 #endif
  96 #ifdef TARGET_OS_FAMILY_solaris
  97 # include "interfaceSupport_solaris.hpp"
  98 #endif
  99 #ifdef TARGET_OS_FAMILY_windows
 100 # include "interfaceSupport_windows.hpp"
 101 #endif
 102 #ifdef TARGET_OS_FAMILY_aix
 103 # include "interfaceSupport_aix.hpp"
 104 #endif
 105 #ifdef TARGET_OS_FAMILY_bsd
 106 # include "interfaceSupport_bsd.hpp"
 107 #endif
 108 
 109 };
 110 
 111 
 112 // Basic class for all thread transition classes.
 113 
 114 class ThreadStateTransition : public StackObj {
 115  protected:
 116   JavaThread* _thread;
 117  public:
 118   ThreadStateTransition(JavaThread *thread) {
 119     _thread = thread;
 120     assert(thread != NULL && thread->is_Java_thread(), "must be Java thread");
 121   }
 122 
 123   // Change threadstate in a manner, so safepoint can detect changes.
 124   // Time-critical: called on exit from every runtime routine
 125   static inline void transition(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
 126     assert(from != _thread_in_Java, "use transition_from_java");
 127     assert(from != _thread_in_native, "use transition_from_native");




  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_RUNTIME_INTERFACESUPPORT_HPP
  26 #define SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP
  27 
  28 #include "gc/shared/gcLocker.hpp"
  29 #include "runtime/handles.inline.hpp"
  30 #include "runtime/mutexLocker.hpp"
  31 #include "runtime/orderAccess.hpp"
  32 #include "runtime/os.hpp"
  33 #include "runtime/safepoint.hpp"
  34 #include "runtime/thread.inline.hpp"
  35 #include "runtime/vmThread.hpp"
  36 #include "utilities/globalDefinitions.hpp"
  37 #include "utilities/macros.hpp"
  38 #include "utilities/preserveException.hpp"
  39 
  40 // Wrapper for all entry points to the virtual machine.
  41 // The HandleMarkCleaner is a faster version of HandleMark.
  42 // It relies on the fact that there is a HandleMark further
  43 // down the stack (in JavaCalls::call_helper), and just resets
  44 // to the saved values in that HandleMark.
  45 
  46 class HandleMarkCleaner: public StackObj {
  47  private:
  48   Thread* _thread;
  49  public:
  50   HandleMarkCleaner(Thread* thread) {
  51     _thread = thread;
  52     _thread->last_handle_mark()->push();
  53   }
  54   ~HandleMarkCleaner() {
  55     _thread->last_handle_mark()->pop_and_restore();
  56   }
  57 


  74   static long _number_of_calls;
  75   static long _fullgc_alot_invocation;
  76 
  77   // Helper methods used to implement +ScavengeALot and +FullGCALot
  78   static void check_gc_alot() { if (ScavengeALot || FullGCALot) gc_alot(); }
  79   static void gc_alot();
  80 
  81   static void walk_stack_from(vframe* start_vf);
  82   static void walk_stack();
  83 
  84   static void zombieAll();
  85   static void unlinkSymbols();
  86   static void deoptimizeAll();
  87   static void stress_derived_pointers();
  88   static void verify_stack();
  89   static void verify_last_frame();
  90 # endif
  91 
  92  public:
  93   // OS dependent stuff
  94 
  95 #include OS_HEADER(interfaceSupport)













  96 
  97 };
  98 
  99 
 100 // Basic class for all thread transition classes.
 101 
 102 class ThreadStateTransition : public StackObj {
 103  protected:
 104   JavaThread* _thread;
 105  public:
 106   ThreadStateTransition(JavaThread *thread) {
 107     _thread = thread;
 108     assert(thread != NULL && thread->is_Java_thread(), "must be Java thread");
 109   }
 110 
 111   // Change threadstate in a manner, so safepoint can detect changes.
 112   // Time-critical: called on exit from every runtime routine
 113   static inline void transition(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
 114     assert(from != _thread_in_Java, "use transition_from_java");
 115     assert(from != _thread_in_native, "use transition_from_native");


< prev index next >