Mercurial > hg > truffle
diff src/share/vm/prims/jvmtiImpl.hpp @ 1878:fa83ab460c54
6988353: refactor contended sync subsystem
Summary: reduce complexity by factoring synchronizer.cpp
Reviewed-by: dholmes, never, coleenp
author | acorn |
---|---|
date | Fri, 22 Oct 2010 15:59:34 -0400 |
parents | c18cbe5936b8 |
children | f95d63e2154a |
line wrap: on
line diff
--- a/src/share/vm/prims/jvmtiImpl.hpp Mon Oct 18 09:33:24 2010 -0700 +++ b/src/share/vm/prims/jvmtiImpl.hpp Fri Oct 22 15:59:34 2010 -0400 @@ -26,7 +26,6 @@ // Forward Declarations // -class JvmtiRawMonitor; class JvmtiBreakpoint; class JvmtiBreakpoints; @@ -327,76 +326,6 @@ return false; } - -/////////////////////////////////////////////////////////////// -// -// class JvmtiRawMonitor -// -// Used by JVMTI methods: All RawMonitor methods (CreateRawMonitor, EnterRawMonitor, etc.) -// -// Wrapper for ObjectMonitor class that saves the Monitor's name -// - -class JvmtiRawMonitor : public ObjectMonitor { -private: - int _magic; - char * _name; - // JVMTI_RM_MAGIC is set in contructor and unset in destructor. - enum { JVMTI_RM_MAGIC = (int)(('T' << 24) | ('I' << 16) | ('R' << 8) | 'M') }; - -public: - JvmtiRawMonitor(const char *name); - ~JvmtiRawMonitor(); - int magic() { return _magic; } - const char *get_name() { return _name; } - bool is_valid(); -}; - -// Onload pending raw monitors -// Class is used to cache onload or onstart monitor enter -// which will transition into real monitor when -// VM is fully initialized. -class JvmtiPendingMonitors : public AllStatic { - -private: - static GrowableArray<JvmtiRawMonitor*> *_monitors; // Cache raw monitor enter - - inline static GrowableArray<JvmtiRawMonitor*>* monitors() { return _monitors; } - - static void dispose() { - delete monitors(); - } - -public: - static void enter(JvmtiRawMonitor *monitor) { - monitors()->append(monitor); - } - - static int count() { - return monitors()->length(); - } - - static void destroy(JvmtiRawMonitor *monitor) { - while (monitors()->contains(monitor)) { - monitors()->remove(monitor); - } - } - - // Return false if monitor is not found in the list. - static bool exit(JvmtiRawMonitor *monitor) { - if (monitors()->contains(monitor)) { - monitors()->remove(monitor); - return true; - } else { - return false; - } - } - - static void transition_raw_monitors(); -}; - - - /////////////////////////////////////////////////////////////// // The get/set local operations must only be done by the VM thread // because the interpreter version needs to access oop maps, which can