open Udiff src/hotspot/share/gc/shared/gcLocker.hpp (original) (raw)

< prev index next >

Print this page


@@ -23,14 +23,15 @@ */

#ifndef SHARE_VM_GC_SHARED_GCLOCKER_HPP #define SHARE_VM_GC_SHARED_GCLOCKER_HPP

-#include "gc/shared/collectedHeap.hpp" -#include "gc/shared/genCollectedHeap.hpp" -#include "memory/universe.hpp" -#include "oops/oop.hpp" +#include "memory/allocation.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + +class JavaThread;

// The direct lock/unlock calls do not force a collection if an unlock // decrements the count to zero. Avoid calling these if at all possible.

class GCLocker: public AllStatic {


@@ -63,14 +64,17 @@ verify_critical_count(); return _jni_lock_count > 0; }

static void log_debug_jni(const char* msg); +

// Shorthand


@@ -133,198 +137,12 @@ // after the safepoint. Since after a safepoint, each of the // following two methods is either entered from the method entry and // falls into the slow path, or is resumed from the safepoints in // the method, which only exist in the slow path. So when _needs_gc // is set, the slow path is always taken, till _needs_gc is cleared. - static void lock_critical(JavaThread* thread); - static void unlock_critical(JavaThread* thread); + inline static void lock_critical(JavaThread* thread); + inline static void unlock_critical(JavaThread* thread); static address needs_gc_address() { return (address) &_needs_gc; } };

-// A NoGCVerifier object can be placed in methods where one assumes that -// no garbage collection will occur. The destructor will verify this property -// unless the constructor is called with argument false (not verifygc). -// -// The check will only be done in debug mode and if verifygc true.

-class NoGCVerifier: public StackObj { - friend class PauseNoGCVerifier;

-#else - SkipGCALot(Thread* t) { } - ~SkipGCALot() { } -#endif -};

-// JRT_LEAF currently can be called from either _thread_in_Java or -// _thread_in_native mode. In _thread_in_native, it is ok -// for another thread to trigger GC. The rest of the JRT_LEAF -// rules apply. -class JRTLeafVerifier : public NoSafepointVerifier { - static bool should_verify_GC(); - public: -#ifdef ASSERT - JRTLeafVerifier(); - ~JRTLeafVerifier(); -#else - JRTLeafVerifier() {} - ~JRTLeafVerifier() {} -#endif -};

-// A NoAllocVerifier object can be placed in methods where one assumes that -// no allocation will occur. The destructor will verify this property -// unless the constructor is called with argument false (not activated). -// -// The check will only be done in debug mode and if activated. -// Note: this only makes sense at safepoints (otherwise, other threads may -// allocate concurrently.)

-class NoAllocVerifier : public StackObj { - private: - bool _activated;

< prev index next >