# HG changeset patch # User zgu # Date 1550676166 18000 # Node ID 46ef4dea49e55d4ee21090c810b373d13441c84e # Parent 8c6a3535b9cb2fde32abdc256255f8d6147b29e9 8219370: NMT: Move synchronization primitives from mtInternal to mtSynchronizer Reviewed-by: dholmes, rehn diff -r 8c6a3535b9cb -r 46ef4dea49e5 src/hotspot/os/posix/os_posix.hpp --- a/src/hotspot/os/posix/os_posix.hpp Wed Feb 20 14:44:58 2019 +0100 +++ b/src/hotspot/os/posix/os_posix.hpp Wed Feb 20 10:22:46 2019 -0500 @@ -177,7 +177,7 @@ * These event objects are type-stable and immortal - we never delete them. * Events are associated with a thread for the lifetime of the thread. */ -class PlatformEvent : public CHeapObj { +class PlatformEvent : public CHeapObj { private: double cachePad[4]; // Increase odds that _mutex is sole occupant of cache line volatile int _event; // Event count/permit: -1, 0 or 1 @@ -212,7 +212,7 @@ // API updates of course). But Parker methods use fastpaths that break that // level of encapsulation - so combining the two remains a future project. -class PlatformParker : public CHeapObj { +class PlatformParker : public CHeapObj { protected: enum { REL_INDEX = 0, @@ -230,7 +230,7 @@ }; // Platform specific implementation that underpins VM Monitor/Mutex class -class PlatformMonitor : public CHeapObj { +class PlatformMonitor : public CHeapObj { private: pthread_mutex_t _mutex; // Native mutex for locking pthread_cond_t _cond; // Native condition variable for blocking diff -r 8c6a3535b9cb -r 46ef4dea49e5 src/hotspot/os/solaris/os_solaris.hpp --- a/src/hotspot/os/solaris/os_solaris.hpp Wed Feb 20 14:44:58 2019 +0100 +++ b/src/hotspot/os/solaris/os_solaris.hpp Wed Feb 20 10:22:46 2019 -0500 @@ -281,7 +281,7 @@ }; -class PlatformEvent : public CHeapObj { +class PlatformEvent : public CHeapObj { private: double CachePad[4]; // increase odds that _mutex is sole occupant of cache line volatile int _Event; @@ -317,7 +317,7 @@ void unpark(); }; -class PlatformParker : public CHeapObj { +class PlatformParker : public CHeapObj { protected: mutex_t _mutex[1]; cond_t _cond[1]; @@ -336,7 +336,7 @@ }; // Platform specific implementation that underpins VM Monitor/Mutex class -class PlatformMonitor : public CHeapObj { +class PlatformMonitor : public CHeapObj { private: mutex_t _mutex; // Native mutex for locking cond_t _cond; // Native condition variable for blocking diff -r 8c6a3535b9cb -r 46ef4dea49e5 src/hotspot/os/windows/os_windows.hpp --- a/src/hotspot/os/windows/os_windows.hpp Wed Feb 20 14:44:58 2019 +0100 +++ b/src/hotspot/os/windows/os_windows.hpp Wed Feb 20 10:22:46 2019 -0500 @@ -148,7 +148,7 @@ static volatile intptr_t _crash_mux; }; -class PlatformEvent : public CHeapObj { +class PlatformEvent : public CHeapObj { private: double CachePad [4] ; // increase odds that _Event is sole occupant of cache line volatile int _Event ; @@ -174,7 +174,7 @@ -class PlatformParker : public CHeapObj { +class PlatformParker : public CHeapObj { protected: HANDLE _ParkEvent ; @@ -188,7 +188,7 @@ } ; // Platform specific implementation that underpins VM Monitor/Mutex class -class PlatformMonitor : public CHeapObj { +class PlatformMonitor : public CHeapObj { private: CRITICAL_SECTION _mutex; // Native mutex for locking CONDITION_VARIABLE _cond; // Native condition variable for blocking diff -r 8c6a3535b9cb -r 46ef4dea49e5 src/hotspot/share/memory/allocation.hpp --- a/src/hotspot/share/memory/allocation.hpp Wed Feb 20 14:44:58 2019 +0100 +++ b/src/hotspot/share/memory/allocation.hpp Wed Feb 20 10:22:46 2019 -0500 @@ -132,6 +132,7 @@ f(mtArguments, "Arguments") \ f(mtModule, "Module") \ f(mtSafepoint, "Safepoint") \ + f(mtSynchronizer, "Synchronization") \ f(mtNone, "Unknown") \ //end diff -r 8c6a3535b9cb -r 46ef4dea49e5 src/hotspot/share/runtime/monitorChunk.cpp --- a/src/hotspot/share/runtime/monitorChunk.cpp Wed Feb 20 14:44:58 2019 +0100 +++ b/src/hotspot/share/runtime/monitorChunk.cpp Wed Feb 20 10:22:46 2019 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ MonitorChunk::MonitorChunk(int number_on_monitors) { _number_of_monitors = number_on_monitors; - _monitors = NEW_C_HEAP_ARRAY(BasicObjectLock, number_on_monitors, mtInternal); + _monitors = NEW_C_HEAP_ARRAY(BasicObjectLock, number_on_monitors, mtSynchronizer); _next = NULL; } diff -r 8c6a3535b9cb -r 46ef4dea49e5 src/hotspot/share/runtime/monitorChunk.hpp --- a/src/hotspot/share/runtime/monitorChunk.hpp Wed Feb 20 14:44:58 2019 +0100 +++ b/src/hotspot/share/runtime/monitorChunk.hpp Wed Feb 20 10:22:46 2019 -0500 @@ -30,7 +30,7 @@ // Data structure for holding monitors for one activation during // deoptimization. -class MonitorChunk: public CHeapObj { +class MonitorChunk: public CHeapObj { private: int _number_of_monitors; BasicObjectLock* _monitors; diff -r 8c6a3535b9cb -r 46ef4dea49e5 src/hotspot/share/runtime/mutex.hpp --- a/src/hotspot/share/runtime/mutex.hpp Wed Feb 20 14:44:58 2019 +0100 +++ b/src/hotspot/share/runtime/mutex.hpp Wed Feb 20 10:22:46 2019 -0500 @@ -39,7 +39,7 @@ // TODO: Check if _name[MONITOR_NAME_LEN] should better get replaced by const char*. static const int MONITOR_NAME_LEN = 64; -class Monitor : public CHeapObj { +class Monitor : public CHeapObj { public: // A special lock: Is a lock where you are guaranteed not to block while you are diff -r 8c6a3535b9cb -r 46ef4dea49e5 src/hotspot/share/runtime/semaphore.hpp --- a/src/hotspot/share/runtime/semaphore.hpp Wed Feb 20 14:44:58 2019 +0100 +++ b/src/hotspot/share/runtime/semaphore.hpp Wed Feb 20 10:22:46 2019 -0500 @@ -40,7 +40,7 @@ class JavaThread; // Implements the limited, platform independent Semaphore API. -class Semaphore : public CHeapObj { +class Semaphore : public CHeapObj { SemaphoreImpl _impl; // Prevent copying and assignment of Semaphore instances.