src/share/vm/runtime/thread.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File webrev Sdiff src/share/vm/runtime

src/share/vm/runtime/thread.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 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  *


  39 #include "runtime/park.hpp"
  40 #include "runtime/safepoint.hpp"
  41 #include "runtime/stubRoutines.hpp"
  42 #include "runtime/threadLocalStorage.hpp"
  43 #include "runtime/thread_ext.hpp"
  44 #include "runtime/unhandledOops.hpp"
  45 #include "trace/traceBackend.hpp"
  46 #include "trace/traceMacros.hpp"
  47 #include "utilities/align.hpp"
  48 #include "utilities/exceptions.hpp"
  49 #include "utilities/macros.hpp"
  50 #if INCLUDE_ALL_GCS
  51 #include "gc/g1/dirtyCardQueue.hpp"
  52 #include "gc/g1/satbMarkQueue.hpp"
  53 #endif // INCLUDE_ALL_GCS
  54 #ifdef ZERO
  55 # include "stack_zero.hpp"
  56 #endif
  57 
  58 class ThreadSafepointState;
  59 class ThreadProfiler;
  60 
  61 class JvmtiThreadState;
  62 class JvmtiGetLoadedClassesClosure;
  63 class ThreadStatistics;
  64 class ConcurrentLocksDump;
  65 class ParkEvent;
  66 class Parker;
  67 
  68 class ciEnv;
  69 class CompileThread;
  70 class CompileLog;
  71 class CompileTask;
  72 class CompileQueue;
  73 class CompilerCounters;
  74 class vframeArray;
  75 
  76 class DeoptResourceMark;
  77 class jvmtiDeferredLocalVariableSet;
  78 
  79 class GCTaskQueue;


1702   void trace_stack()                             PRODUCT_RETURN;
1703   void trace_stack_from(vframe* start_vf)        PRODUCT_RETURN;
1704   void trace_frames()                            PRODUCT_RETURN;
1705   void trace_oops()                              PRODUCT_RETURN;
1706 
1707   // Print an annotated view of the stack frames
1708   void print_frame_layout(int depth = 0, bool validate_only = false) NOT_DEBUG_RETURN;
1709   void validate_frame_layout() {
1710     print_frame_layout(0, true);
1711   }
1712 
1713   // Returns the number of stack frames on the stack
1714   int depth() const;
1715 
1716   // Function for testing deoptimization
1717   void deoptimize();
1718   void make_zombies();
1719 
1720   void deoptimized_wrt_marked_nmethods();
1721 
1722   // Profiling operation (see fprofile.cpp)
1723  public:
1724   bool profile_last_Java_frame(frame* fr);
1725 
1726  private:
1727   ThreadProfiler* _thread_profiler;
1728  private:
1729   friend class FlatProfiler;                    // uses both [gs]et_thread_profiler.
1730   friend class FlatProfilerTask;                // uses get_thread_profiler.
1731   friend class ThreadProfilerMark;              // uses get_thread_profiler.
1732   ThreadProfiler* get_thread_profiler()         { return _thread_profiler; }
1733   ThreadProfiler* set_thread_profiler(ThreadProfiler* tp) {
1734     ThreadProfiler* result = _thread_profiler;
1735     _thread_profiler = tp;
1736     return result;
1737   }
1738 
1739  public:
1740   // Returns the running thread as a JavaThread
1741   static inline JavaThread* current();
1742 
1743   // Returns the active Java thread.  Do not use this if you know you are calling
1744   // from a JavaThread, as it's slower than JavaThread::current.  If called from
1745   // the VMThread, it also returns the JavaThread that instigated the VMThread's
1746   // operation.  You may not want that either.
1747   static JavaThread* active();
1748 
1749   inline CompilerThread* as_CompilerThread();
1750 
1751  public:
1752   virtual void run();
1753   void thread_main_inner();
1754 
1755  private:
1756   // PRIVILEGED STACK
1757   PrivilegedElement*  _privileged_stack_top;
1758   GrowableArray<oop>* _array_for_gc;


   1 /*
   2  * Copyright (c) 1997, 2017, 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  *


  39 #include "runtime/park.hpp"
  40 #include "runtime/safepoint.hpp"
  41 #include "runtime/stubRoutines.hpp"
  42 #include "runtime/threadLocalStorage.hpp"
  43 #include "runtime/thread_ext.hpp"
  44 #include "runtime/unhandledOops.hpp"
  45 #include "trace/traceBackend.hpp"
  46 #include "trace/traceMacros.hpp"
  47 #include "utilities/align.hpp"
  48 #include "utilities/exceptions.hpp"
  49 #include "utilities/macros.hpp"
  50 #if INCLUDE_ALL_GCS
  51 #include "gc/g1/dirtyCardQueue.hpp"
  52 #include "gc/g1/satbMarkQueue.hpp"
  53 #endif // INCLUDE_ALL_GCS
  54 #ifdef ZERO
  55 # include "stack_zero.hpp"
  56 #endif
  57 
  58 class ThreadSafepointState;

  59 
  60 class JvmtiThreadState;
  61 class JvmtiGetLoadedClassesClosure;
  62 class ThreadStatistics;
  63 class ConcurrentLocksDump;
  64 class ParkEvent;
  65 class Parker;
  66 
  67 class ciEnv;
  68 class CompileThread;
  69 class CompileLog;
  70 class CompileTask;
  71 class CompileQueue;
  72 class CompilerCounters;
  73 class vframeArray;
  74 
  75 class DeoptResourceMark;
  76 class jvmtiDeferredLocalVariableSet;
  77 
  78 class GCTaskQueue;


1701   void trace_stack()                             PRODUCT_RETURN;
1702   void trace_stack_from(vframe* start_vf)        PRODUCT_RETURN;
1703   void trace_frames()                            PRODUCT_RETURN;
1704   void trace_oops()                              PRODUCT_RETURN;
1705 
1706   // Print an annotated view of the stack frames
1707   void print_frame_layout(int depth = 0, bool validate_only = false) NOT_DEBUG_RETURN;
1708   void validate_frame_layout() {
1709     print_frame_layout(0, true);
1710   }
1711 
1712   // Returns the number of stack frames on the stack
1713   int depth() const;
1714 
1715   // Function for testing deoptimization
1716   void deoptimize();
1717   void make_zombies();
1718 
1719   void deoptimized_wrt_marked_nmethods();
1720 

















1721  public:
1722   // Returns the running thread as a JavaThread
1723   static inline JavaThread* current();
1724 
1725   // Returns the active Java thread.  Do not use this if you know you are calling
1726   // from a JavaThread, as it's slower than JavaThread::current.  If called from
1727   // the VMThread, it also returns the JavaThread that instigated the VMThread's
1728   // operation.  You may not want that either.
1729   static JavaThread* active();
1730 
1731   inline CompilerThread* as_CompilerThread();
1732 
1733  public:
1734   virtual void run();
1735   void thread_main_inner();
1736 
1737  private:
1738   // PRIVILEGED STACK
1739   PrivilegedElement*  _privileged_stack_top;
1740   GrowableArray<oop>* _array_for_gc;


src/share/vm/runtime/thread.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File