8219370: NMT: Move synchronization primitives from mtInternal to mtSynchronizer
authorzgu
Wed, 20 Feb 2019 10:22:46 -0500
changeset 53849 46ef4dea49e5
parent 53848 8c6a3535b9cb
child 53850 f42c58bab973
8219370: NMT: Move synchronization primitives from mtInternal to mtSynchronizer Reviewed-by: dholmes, rehn
src/hotspot/os/posix/os_posix.hpp
src/hotspot/os/solaris/os_solaris.hpp
src/hotspot/os/windows/os_windows.hpp
src/hotspot/share/memory/allocation.hpp
src/hotspot/share/runtime/monitorChunk.cpp
src/hotspot/share/runtime/monitorChunk.hpp
src/hotspot/share/runtime/mutex.hpp
src/hotspot/share/runtime/semaphore.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<mtInternal> {
+class PlatformEvent : public CHeapObj<mtSynchronizer> {
  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<mtInternal> {
+class PlatformParker : public CHeapObj<mtSynchronizer> {
  protected:
   enum {
     REL_INDEX = 0,
@@ -230,7 +230,7 @@
 };
 
 // Platform specific implementation that underpins VM Monitor/Mutex class
-class PlatformMonitor : public CHeapObj<mtInternal> {
+class PlatformMonitor : public CHeapObj<mtSynchronizer> {
  private:
   pthread_mutex_t _mutex; // Native mutex for locking
   pthread_cond_t  _cond;  // Native condition variable for blocking
--- 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<mtInternal> {
+class PlatformEvent : public CHeapObj<mtSynchronizer> {
  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<mtInternal> {
+class PlatformParker : public CHeapObj<mtSynchronizer> {
  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<mtInternal> {
+class PlatformMonitor : public CHeapObj<mtSynchronizer> {
  private:
   mutex_t _mutex; // Native mutex for locking
   cond_t  _cond;  // Native condition variable for blocking
--- 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<mtInternal> {
+class PlatformEvent : public CHeapObj<mtSynchronizer> {
   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<mtInternal> {
+class PlatformParker : public CHeapObj<mtSynchronizer> {
   protected:
     HANDLE _ParkEvent ;
 
@@ -188,7 +188,7 @@
 } ;
 
 // Platform specific implementation that underpins VM Monitor/Mutex class
-class PlatformMonitor : public CHeapObj<mtInternal> {
+class PlatformMonitor : public CHeapObj<mtSynchronizer> {
  private:
   CRITICAL_SECTION   _mutex; // Native mutex for locking
   CONDITION_VARIABLE _cond;  // Native condition variable for blocking
--- 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
 
--- 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;
 }
 
--- 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<mtInternal> {
+class MonitorChunk: public CHeapObj<mtSynchronizer> {
  private:
   int              _number_of_monitors;
   BasicObjectLock* _monitors;
--- 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<mtInternal> {
+class Monitor : public CHeapObj<mtSynchronizer> {
 
  public:
   // A special lock: Is a lock where you are guaranteed not to block while you are
--- 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<mtInternal> {
+class Semaphore : public CHeapObj<mtSynchronizer> {
   SemaphoreImpl _impl;
 
   // Prevent copying and assignment of Semaphore instances.