提交 8f0e81e6 编写于 作者: Z zgu

8219370: NMT: Move synchronization primitives from mtInternal to mtSynchronizer

Reviewed-by: dholmes, rehn
上级 633c12a0
......@@ -166,7 +166,7 @@ private:
* 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
......@@ -201,7 +201,7 @@ class PlatformEvent : public CHeapObj<mtInternal> {
// 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,
......
......@@ -281,7 +281,7 @@ class Solaris {
};
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 @@ class PlatformEvent : public CHeapObj<mtInternal> {
void unpark();
};
class PlatformParker : public CHeapObj<mtInternal> {
class PlatformParker : public CHeapObj<mtSynchronizer> {
protected:
mutex_t _mutex[1];
cond_t _cond[1];
......
......@@ -160,7 +160,7 @@ private:
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 ;
......@@ -186,7 +186,7 @@ class PlatformEvent : public CHeapObj<mtInternal> {
class PlatformParker : public CHeapObj<mtInternal> {
class PlatformParker : public CHeapObj<mtSynchronizer> {
protected:
HANDLE _ParkEvent ;
......
......@@ -133,6 +133,7 @@ enum MemoryType {
mtLogging, // memory for logging
mtArguments, // memory for argument processing
mtModule, // memory for module processing
mtSynchronizer, // memory for synchronization primitives
mtSafepoint, // memory for safepoint support
mtNone, // undefined
mt_number_of_types // number of memory types (mtDontTrack
......
/*
* 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;
}
......
......@@ -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;
......
......@@ -79,7 +79,7 @@ class ParkEvent ;
// 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
......
......@@ -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.
......
......@@ -44,6 +44,7 @@ const char* NMTUtil::_memory_type_names[] = {
"Logging",
"Arguments",
"Module",
"Synchronizer",
"Safepoint",
"Unknown"
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册