From 9e9ac093ae4d2447a5f487341f219521d01d731b Mon Sep 17 00:00:00 2001
From: Sergey Bylokhov
Date: Tue, 26 Jun 2012 13:46:09 +0400
Subject: [PATCH 01/44] 7142091: [macosx] RFE: Refactoring of peer
initialization/disposing
Reviewed-by: anthony, art
---
.../classes/sun/lwawt/LWButtonPeer.java | 4 +-
.../classes/sun/lwawt/LWCheckboxPeer.java | 4 +-
.../classes/sun/lwawt/LWChoicePeer.java | 4 +-
.../classes/sun/lwawt/LWComponentPeer.java | 80 +++++++++---------
.../macosx/classes/sun/lwawt/LWLabelPeer.java | 4 +-
.../macosx/classes/sun/lwawt/LWListPeer.java | 4 +-
.../classes/sun/lwawt/LWScrollBarPeer.java | 4 +-
.../classes/sun/lwawt/LWScrollPanePeer.java | 4 +-
.../classes/sun/lwawt/LWTextAreaPeer.java | 4 +-
.../sun/lwawt/LWTextComponentPeer.java | 4 +-
.../classes/sun/lwawt/LWTextFieldPeer.java | 4 +-
.../classes/sun/lwawt/LWWindowPeer.java | 84 ++++++++-----------
.../sun/lwawt/macosx/CPlatformWindow.java | 24 +-----
jdk/src/macosx/native/sun/awt/AWTWindow.m | 21 -----
14 files changed, 100 insertions(+), 149 deletions(-)
diff --git a/jdk/src/macosx/classes/sun/lwawt/LWButtonPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWButtonPeer.java
index f0cd54d93b3..e5f8838c8cd 100644
--- a/jdk/src/macosx/classes/sun/lwawt/LWButtonPeer.java
+++ b/jdk/src/macosx/classes/sun/lwawt/LWButtonPeer.java
@@ -47,8 +47,8 @@ final class LWButtonPeer extends LWComponentPeer
*/
-public interface MonitoringManager {
+public interface MonitoringManager extends Closeable {
///////////////////////////////////////
// operations
diff --git a/corba/src/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java b/corba/src/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java
index a23dfc3d0d6..88b6238ff53 100644
--- a/corba/src/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java
+++ b/corba/src/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -40,4 +40,6 @@ public interface MonitoringManagerFactory {
*/
MonitoringManager createMonitoringManager( String nameOfTheRoot,
String description );
+
+ void remove(String nameOfTheRoot);
}
diff --git a/corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java b/corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java
index 0fad97f78ba..22b89e73f22 100644
--- a/corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java
+++ b/corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -171,7 +171,7 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
private static Map staticWrapperMap = new ConcurrentHashMap();
- private MonitoringManager monitoringManager;
+ protected MonitoringManager monitoringManager;
// There is only one instance of the PresentationManager
// that is shared between all ORBs. This is necessary
@@ -226,6 +226,14 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
globalPM.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
}
+ public void destroy() {
+ wrapper = null;
+ omgWrapper = null;
+ typeCodeMap = null;
+ primitiveTypeCodeConstants = null;
+ byteBufferPool = null;
+ }
+
/** Get the single instance of the PresentationManager
*/
public static PresentationManager getPresentationManager()
@@ -302,6 +310,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
// Typecode support: needed in both ORBImpl and ORBSingleton
public TypeCodeImpl get_primitive_tc(int kind)
{
+ synchronized (this) {
+ checkShutdownState();
+ }
try {
return primitiveTypeCodeConstants[kind] ;
} catch (Throwable t) {
@@ -311,15 +322,20 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
public synchronized void setTypeCode(String id, TypeCodeImpl code)
{
+ checkShutdownState();
typeCodeMap.put(id, code);
}
public synchronized TypeCodeImpl getTypeCode(String id)
{
+ checkShutdownState();
return (TypeCodeImpl)typeCodeMap.get(id);
}
public MonitoringManager getMonitoringManager( ) {
+ synchronized (this) {
+ checkShutdownState();
+ }
return monitoringManager;
}
@@ -434,6 +450,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
*/
public Logger getLogger( String domain )
{
+ synchronized (this) {
+ checkShutdownState();
+ }
ORBData odata = getORBData() ;
// Determine the correct ORBId. There are 3 cases:
@@ -510,6 +529,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
// This method must also be inherited by both ORB and ORBSingleton.
public ByteBufferPool getByteBufferPool()
{
+ synchronized (this) {
+ checkShutdownState();
+ }
if (byteBufferPool == null)
byteBufferPool = new ByteBufferPoolImpl(this);
diff --git a/corba/src/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPool.java b/corba/src/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPool.java
index a4cc2b6a559..dd61ff22032 100644
--- a/corba/src/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPool.java
+++ b/corba/src/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPool.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -25,9 +25,15 @@
package com.sun.corba.se.spi.orbutil.threadpool;
+import java.io.Closeable;
-public interface ThreadPool
+/** This interface defines a thread pool execution service. The ORB uses this
+ * interface, which preceeds the JDK 5 ExecutorService. Note that the close
+ * method must be called in order to reclaim thread resources.
+ */
+public interface ThreadPool extends Closeable
{
+
/**
* This method will return any instance of the WorkQueue. If the ThreadPool
* instance only services one WorkQueue then that WorkQueue instance will
diff --git a/corba/src/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPoolManager.java b/corba/src/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPoolManager.java
index 9225a90a598..14875f6d20a 100644
--- a/corba/src/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPoolManager.java
+++ b/corba/src/share/classes/com/sun/corba/se/spi/orbutil/threadpool/ThreadPoolManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -25,7 +25,9 @@
package com.sun.corba.se.spi.orbutil.threadpool;
-public interface ThreadPoolManager
+import java.io.Closeable;
+
+public interface ThreadPoolManager extends Closeable
{
/**
* This method will return an instance of the threadpool given a threadpoolId,
diff --git a/corba/src/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java b/corba/src/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java
index b59062a43be..ac25b79510a 100644
--- a/corba/src/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java
+++ b/corba/src/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -25,6 +25,8 @@
package com.sun.corba.se.spi.protocol;
+import java.io.Closeable;
+
import org.omg.PortableInterceptor.ObjectReferenceTemplate ;
import org.omg.PortableInterceptor.Interceptor ;
import org.omg.PortableInterceptor.Current ;
@@ -51,7 +53,7 @@ import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage ;
/** This interface defines the PI interface that is used to interface the rest of the
* ORB to the PI implementation.
*/
-public interface PIHandler {
+public interface PIHandler extends Closeable {
/** Complete the initialization of the PIHandler. This will execute the methods
* on the ORBInitializers, if any are defined. This must be done here so that
* the ORB can obtain the PIHandler BEFORE the ORBInitializers run, since they
diff --git a/corba/src/share/classes/com/sun/corba/se/spi/protocol/RequestDispatcherRegistry.java b/corba/src/share/classes/com/sun/corba/se/spi/protocol/RequestDispatcherRegistry.java
index e4fc9ae4265..f5aae43731d 100644
--- a/corba/src/share/classes/com/sun/corba/se/spi/protocol/RequestDispatcherRegistry.java
+++ b/corba/src/share/classes/com/sun/corba/se/spi/protocol/RequestDispatcherRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -37,33 +37,59 @@ import com.sun.corba.se.spi.oa.ObjectAdapterFactory ;
* This is a registry of all subcontract ID dependent objects. This includes:
* LocalClientRequestDispatcherFactory, ClientRequestDispatcher, ServerRequestDispatcher, and
* ObjectAdapterFactory.
- * XXX Should the registerXXX methods take an scid or not? I think we
- * want to do this so that the same instance can be shared across multiple
- * scids (and this is already true for ObjectAdapterFactory and LocalClientRequestDispatcherFactory),
- * but this will require some changes for ClientRequestDispatcher and ServerRequestDispatcher.
*/
public interface RequestDispatcherRegistry {
- // XXX needs javadocs!
+ /** Register a ClientRequestDispatcher for a particular subcontract ID.
+ * The subcontract ID appears in the ObjectKey of an object reference, and is used
+ * to control how a remote method invocation is processed by the ORB for a
+ * particular kind of object reference.
+ */
void registerClientRequestDispatcher( ClientRequestDispatcher csc, int scid) ;
+ /** Get the ClientRequestDispatcher for subcontract ID scid.
+ */
ClientRequestDispatcher getClientRequestDispatcher( int scid ) ;
+ /** Register a LocalClientRequestDispatcher for a particular subcontract ID.
+ * The subcontract ID appears in the ObjectKey of an object reference, and is used
+ * to control how a particular kind of colocated request is processed.
+ */
void registerLocalClientRequestDispatcherFactory( LocalClientRequestDispatcherFactory csc, int scid) ;
+ /** Get the LocalClientRequestDispatcher for subcontract ID scid.
+ */
LocalClientRequestDispatcherFactory getLocalClientRequestDispatcherFactory( int scid ) ;
+ /** Register a CorbaServerRequestDispatcher for a particular subcontract ID.
+ * The subcontract ID appears in the ObjectKey of an object reference, and is used
+ * to control how a particular kind of request is processed when received by the ORB.
+ */
void registerServerRequestDispatcher( CorbaServerRequestDispatcher ssc, int scid) ;
+ /** Get the CorbaServerRequestDispatcher for subcontract ID scid.
+ */
CorbaServerRequestDispatcher getServerRequestDispatcher(int scid) ;
+ /** Register a CorbaServerRequestDispatcher for handling an explicit object key name.
+ * This is used for non-standard invocations such as INS and the bootstrap name service.
+ */
void registerServerRequestDispatcher( CorbaServerRequestDispatcher ssc, String name ) ;
+ /** Get the CorbaServerRequestDispatcher for a particular object key.
+ */
CorbaServerRequestDispatcher getServerRequestDispatcher( String name ) ;
+ /** Register an ObjectAdapterFactory for a particular subcontract ID.
+ * This controls how Object references are created and managed.
+ */
void registerObjectAdapterFactory( ObjectAdapterFactory oaf, int scid) ;
+ /** Get the ObjectAdapterFactory for a particular subcontract ID scid.
+ */
ObjectAdapterFactory getObjectAdapterFactory( int scid ) ;
- Set getObjectAdapterFactories() ;
+ /** Return the set of all ObjectAdapterFactory instances that are registered.
+ */
+ Set getObjectAdapterFactories();
}
From a39b17624a65f5cff09a88a5bcddbf97e36cc9c3 Mon Sep 17 00:00:00 2001
From: Zhengyu Gu
Date: Thu, 28 Jun 2012 17:03:16 -0400
Subject: [PATCH 09/44] 6995781: Native Memory Tracking (Phase 1) 7151532: DCmd
for hotspot native memory tracking
Implementation of native memory tracking phase 1, which tracks VM native memory usage, and related DCmd
Reviewed-by: acorn, coleenp, fparain
---
.../jvm/hotspot/utilities/BasicHashtable.java | 4 +-
.../utilities/BasicHashtableEntry.java | 2 +-
.../sun/jvm/hotspot/utilities/Hashtable.java | 2 +-
.../hotspot/utilities/HashtableBucket.java | 2 +-
.../jvm/hotspot/utilities/HashtableEntry.java | 2 +-
hotspot/make/bsd/makefiles/jvmg.make | 4 +-
hotspot/make/linux/makefiles/jvmg.make | 6 +-
hotspot/make/solaris/makefiles/jvmg.make | 3 +-
hotspot/make/windows/makefiles/debug.make | 3 +-
hotspot/src/os/bsd/vm/os_bsd.cpp | 30 +-
hotspot/src/os/bsd/vm/os_bsd.hpp | 4 +-
hotspot/src/os/bsd/vm/os_bsd.inline.hpp | 2 +-
hotspot/src/os/bsd/vm/perfMemory_bsd.cpp | 66 +-
hotspot/src/os/linux/vm/os_linux.cpp | 40 +-
hotspot/src/os/linux/vm/os_linux.hpp | 4 +-
hotspot/src/os/linux/vm/os_linux.inline.hpp | 2 +-
hotspot/src/os/linux/vm/perfMemory_linux.cpp | 66 +-
hotspot/src/os/posix/vm/os_posix.cpp | 18 +
hotspot/src/os/solaris/dtrace/hs_private.d | 1 -
hotspot/src/os/solaris/vm/os_solaris.cpp | 60 +-
hotspot/src/os/solaris/vm/os_solaris.hpp | 4 +-
.../src/os/solaris/vm/os_solaris.inline.hpp | 2 +-
.../src/os/solaris/vm/perfMemory_solaris.cpp | 66 +-
hotspot/src/os/windows/vm/os_windows.cpp | 117 ++--
hotspot/src/os/windows/vm/os_windows.hpp | 8 +-
.../src/os/windows/vm/perfMemory_windows.cpp | 106 +--
hotspot/src/share/vm/asm/codeBuffer.cpp | 8 +-
hotspot/src/share/vm/c1/c1_CFGPrinter.cpp | 4 +-
hotspot/src/share/vm/c1/c1_Compiler.cpp | 2 +-
hotspot/src/share/vm/c1/c1_LinearScan.cpp | 12 +-
hotspot/src/share/vm/ci/ciObjectFactory.cpp | 2 +-
.../share/vm/classfile/classFileParser.cpp | 2 +-
.../src/share/vm/classfile/classLoader.cpp | 40 +-
.../src/share/vm/classfile/classLoader.hpp | 8 +-
hotspot/src/share/vm/classfile/dictionary.cpp | 20 +-
hotspot/src/share/vm/classfile/dictionary.hpp | 38 +-
.../src/share/vm/classfile/javaAssertions.cpp | 2 +-
.../src/share/vm/classfile/javaAssertions.hpp | 2 +-
.../share/vm/classfile/loaderConstraints.cpp | 16 +-
.../share/vm/classfile/loaderConstraints.hpp | 14 +-
.../src/share/vm/classfile/placeholders.cpp | 6 +-
.../src/share/vm/classfile/placeholders.hpp | 16 +-
.../share/vm/classfile/resolutionErrors.cpp | 6 +-
.../share/vm/classfile/resolutionErrors.hpp | 15 +-
.../src/share/vm/classfile/symbolTable.cpp | 56 +-
.../src/share/vm/classfile/symbolTable.hpp | 39 +-
.../share/vm/classfile/systemDictionary.cpp | 4 +-
.../share/vm/classfile/systemDictionary.hpp | 5 +-
hotspot/src/share/vm/code/codeBlob.cpp | 4 +-
hotspot/src/share/vm/code/codeCache.cpp | 4 +-
hotspot/src/share/vm/code/codeCache.hpp | 3 +
hotspot/src/share/vm/code/nmethod.hpp | 2 +-
hotspot/src/share/vm/code/stubs.hpp | 4 +-
.../share/vm/compiler/abstractCompiler.hpp | 2 +-
.../src/share/vm/compiler/compileBroker.cpp | 6 +-
.../src/share/vm/compiler/compileBroker.hpp | 6 +-
hotspot/src/share/vm/compiler/compileLog.cpp | 8 +-
.../src/share/vm/compiler/compilerOracle.cpp | 2 +-
hotspot/src/share/vm/compiler/oopMap.cpp | 4 +-
.../compactibleFreeListSpace.hpp | 2 +-
.../concurrentMarkSweepGeneration.cpp | 28 +-
.../concurrentMarkSweepGeneration.hpp | 10 +-
.../g1/collectionSetChooser.hpp | 2 +-
.../g1/concurrentG1Refine.cpp | 22 +-
.../g1/concurrentG1Refine.hpp | 2 +-
.../gc_implementation/g1/concurrentMark.cpp | 17 +-
.../gc_implementation/g1/concurrentMark.hpp | 6 +-
.../gc_implementation/g1/dirtyCardQueue.hpp | 2 +-
.../g1/g1BlockOffsetTable.cpp | 4 +
.../g1/g1BlockOffsetTable.hpp | 2 +-
.../gc_implementation/g1/g1CollectedHeap.cpp | 20 +-
.../gc_implementation/g1/g1CollectedHeap.hpp | 8 +-
.../g1/g1CollectorPolicy.hpp | 6 +-
.../vm/gc_implementation/g1/g1MMUTracker.hpp | 2 +-
.../g1/g1MonitoringSupport.hpp | 2 +-
.../vm/gc_implementation/g1/g1RemSet.cpp | 8 +-
.../vm/gc_implementation/g1/g1RemSet.hpp | 2 +-
.../gc_implementation/g1/heapRegionRemSet.cpp | 20 +-
.../gc_implementation/g1/heapRegionRemSet.hpp | 4 +-
.../vm/gc_implementation/g1/heapRegionSeq.cpp | 2 +-
.../vm/gc_implementation/g1/heapRegionSeq.hpp | 2 +-
.../vm/gc_implementation/g1/ptrQueue.cpp | 4 +-
.../vm/gc_implementation/g1/satbQueue.cpp | 2 +-
.../vm/gc_implementation/g1/sparsePRT.cpp | 8 +-
.../vm/gc_implementation/g1/sparsePRT.hpp | 4 +-
.../vm/gc_implementation/g1/survRateGroup.cpp | 14 +-
.../vm/gc_implementation/g1/survRateGroup.hpp | 2 +-
.../parNew/parCardTableModRefBS.cpp | 4 +-
.../parNew/parGCAllocBuffer.hpp | 2 +-
.../parNew/parNewGeneration.cpp | 21 +-
.../parNew/parNewGeneration.hpp | 10 +-
.../parNew/parOopClosures.hpp | 2 +-
.../parallelScavenge/adjoiningGenerations.hpp | 2 +-
.../parallelScavenge/gcTaskManager.cpp | 22 +-
.../parallelScavenge/gcTaskManager.hpp | 6 +-
.../parallelScavenge/gcTaskThread.cpp | 4 +-
.../parallelScavenge/gcTaskThread.hpp | 2 +-
.../parallelScavenge/objectStartArray.cpp | 6 +
.../parallelScavenge/objectStartArray.hpp | 2 +-
.../parallelScavenge/parMarkBitMap.cpp | 4 +
.../parallelScavenge/parMarkBitMap.hpp | 2 +-
.../parallelScavenge/parallelScavengeHeap.cpp | 3 +
.../parallelScavenge/psCompactionManager.cpp | 6 +-
.../parallelScavenge/psCompactionManager.hpp | 18 +-
.../parallelScavenge/psGenerationCounters.cpp | 2 +-
.../parallelScavenge/psMarkSweepDecorator.hpp | 2 +-
.../parallelScavenge/psOldGen.hpp | 2 +-
.../parallelScavenge/psParallelCompact.cpp | 8 +-
.../parallelScavenge/psPromotionLAB.hpp | 2 +-
.../parallelScavenge/psPromotionManager.cpp | 2 +-
.../parallelScavenge/psPromotionManager.hpp | 4 +-
.../parallelScavenge/psScavenge.cpp | 4 +-
.../parallelScavenge/psScavenge.hpp | 4 +-
.../parallelScavenge/psVirtualspace.hpp | 2 +-
.../parallelScavenge/psYoungGen.hpp | 2 +-
.../shared/adaptiveSizePolicy.hpp | 2 +-
.../shared/cSpaceCounters.cpp | 2 +-
.../shared/cSpaceCounters.hpp | 4 +-
.../shared/collectorCounters.cpp | 2 +-
.../shared/collectorCounters.hpp | 4 +-
.../shared/gSpaceCounters.cpp | 2 +-
.../shared/gSpaceCounters.hpp | 4 +-
.../shared/gcPolicyCounters.hpp | 2 +-
.../vm/gc_implementation/shared/gcStats.hpp | 2 +-
.../vm/gc_implementation/shared/gcUtil.hpp | 6 +-
.../shared/generationCounters.cpp | 2 +-
.../shared/generationCounters.hpp | 4 +-
.../shared/hSpaceCounters.cpp | 2 +-
.../shared/hSpaceCounters.hpp | 4 +-
.../shared/immutableSpace.hpp | 2 +-
.../vm/gc_implementation/shared/markSweep.cpp | 14 +-
.../vm/gc_implementation/shared/markSweep.hpp | 12 +-
.../shared/mutableNUMASpace.cpp | 6 +-
.../shared/mutableNUMASpace.hpp | 2 +-
.../shared/spaceCounters.cpp | 2 +-
.../shared/spaceCounters.hpp | 4 +-
.../shared/spaceDecorator.hpp | 2 +-
.../share/vm/gc_interface/collectedHeap.hpp | 2 +-
.../vm/interpreter/interpreterRuntime.cpp | 4 +-
.../src/share/vm/interpreter/oopMapCache.cpp | 12 +-
.../src/share/vm/interpreter/oopMapCache.hpp | 2 +-
hotspot/src/share/vm/libadt/set.cpp | 6 +-
hotspot/src/share/vm/libadt/vectset.cpp | 2 +-
hotspot/src/share/vm/memory/allocation.cpp | 111 +++-
hotspot/src/share/vm/memory/allocation.hpp | 135 +++-
.../src/share/vm/memory/allocation.inline.hpp | 55 +-
hotspot/src/share/vm/memory/barrierSet.hpp | 2 +-
.../src/share/vm/memory/blockOffsetTable.cpp | 4 +
.../src/share/vm/memory/blockOffsetTable.hpp | 2 +-
.../src/share/vm/memory/cardTableModRefBS.cpp | 13 +-
.../src/share/vm/memory/collectorPolicy.hpp | 2 +-
.../src/share/vm/memory/defNewGeneration.hpp | 6 +-
hotspot/src/share/vm/memory/filemap.hpp | 2 +-
.../share/vm/memory/freeBlockDictionary.hpp | 2 +-
hotspot/src/share/vm/memory/genMarkSweep.cpp | 24 +-
.../src/share/vm/memory/genOopClosures.hpp | 8 +-
hotspot/src/share/vm/memory/genRemSet.hpp | 2 +-
hotspot/src/share/vm/memory/generation.hpp | 2 +-
.../src/share/vm/memory/generationSpec.hpp | 4 +-
hotspot/src/share/vm/memory/heap.cpp | 5 +-
hotspot/src/share/vm/memory/heap.hpp | 2 +-
.../src/share/vm/memory/heapInspection.cpp | 6 +-
.../src/share/vm/memory/heapInspection.hpp | 4 +-
hotspot/src/share/vm/memory/memRegion.hpp | 4 +-
hotspot/src/share/vm/memory/permGen.hpp | 2 +-
.../src/share/vm/memory/referencePolicy.hpp | 2 +-
.../share/vm/memory/referenceProcessor.cpp | 3 +-
.../share/vm/memory/referenceProcessor.hpp | 2 +-
hotspot/src/share/vm/memory/resourceArea.hpp | 23 +-
hotspot/src/share/vm/memory/restore.cpp | 8 +-
hotspot/src/share/vm/memory/space.hpp | 2 +-
.../src/share/vm/memory/tenuredGeneration.cpp | 2 +-
.../vm/memory/threadLocalAllocBuffer.hpp | 4 +-
hotspot/src/share/vm/memory/universe.cpp | 4 +-
hotspot/src/share/vm/memory/universe.hpp | 4 +-
hotspot/src/share/vm/oops/constantPoolOop.hpp | 8 +-
hotspot/src/share/vm/oops/instanceKlass.cpp | 16 +-
hotspot/src/share/vm/oops/instanceKlass.hpp | 6 +-
hotspot/src/share/vm/oops/methodOop.hpp | 2 +-
hotspot/src/share/vm/oops/symbol.cpp | 2 +-
.../src/share/vm/opto/idealGraphPrinter.cpp | 8 +-
hotspot/src/share/vm/opto/macro.cpp | 2 +-
hotspot/src/share/vm/opto/runtime.hpp | 2 +-
hotspot/src/share/vm/opto/type.cpp | 2 +-
hotspot/src/share/vm/prims/jni.cpp | 9 +-
hotspot/src/share/vm/prims/jniCheck.cpp | 6 +-
.../vm/prims/jvmtiClassFileReconstituter.hpp | 4 +-
.../share/vm/prims/jvmtiCodeBlobEvents.cpp | 4 +-
hotspot/src/share/vm/prims/jvmtiEnv.cpp | 4 +-
hotspot/src/share/vm/prims/jvmtiEnvBase.cpp | 4 +-
hotspot/src/share/vm/prims/jvmtiEnvBase.hpp | 6 +-
.../share/vm/prims/jvmtiEnvThreadState.cpp | 2 +-
.../share/vm/prims/jvmtiEnvThreadState.hpp | 4 +-
hotspot/src/share/vm/prims/jvmtiExport.cpp | 8 +-
hotspot/src/share/vm/prims/jvmtiExport.hpp | 2 +-
.../src/share/vm/prims/jvmtiExtensions.cpp | 4 +-
.../share/vm/prims/jvmtiGetLoadedClasses.cpp | 2 +-
hotspot/src/share/vm/prims/jvmtiImpl.cpp | 8 +-
hotspot/src/share/vm/prims/jvmtiImpl.hpp | 8 +-
.../src/share/vm/prims/jvmtiRawMonitor.cpp | 4 +-
.../share/vm/prims/jvmtiRedefineClasses.cpp | 2 +-
hotspot/src/share/vm/prims/jvmtiTagMap.cpp | 30 +-
hotspot/src/share/vm/prims/jvmtiTagMap.hpp | 2 +-
.../src/share/vm/prims/jvmtiThreadState.hpp | 2 +-
hotspot/src/share/vm/prims/jvmtiUtil.cpp | 2 +-
hotspot/src/share/vm/prims/unsafe.cpp | 16 +-
hotspot/src/share/vm/runtime/arguments.cpp | 67 +-
hotspot/src/share/vm/runtime/arguments.hpp | 16 +-
.../src/share/vm/runtime/biasedLocking.cpp | 4 +-
.../share/vm/runtime/compilationPolicy.hpp | 2 +-
.../src/share/vm/runtime/deoptimization.cpp | 12 +-
.../src/share/vm/runtime/deoptimization.hpp | 2 +-
hotspot/src/share/vm/runtime/dtraceJSDT.hpp | 6 +-
hotspot/src/share/vm/runtime/fprofiler.cpp | 14 +-
hotspot/src/share/vm/runtime/fprofiler.hpp | 2 +-
hotspot/src/share/vm/runtime/globals.cpp | 16 +-
hotspot/src/share/vm/runtime/globals.hpp | 4 +-
hotspot/src/share/vm/runtime/handles.cpp | 4 +-
hotspot/src/share/vm/runtime/handles.hpp | 3 +-
.../src/share/vm/runtime/handles.inline.hpp | 2 +-
hotspot/src/share/vm/runtime/java.cpp | 2 +-
hotspot/src/share/vm/runtime/jniHandles.hpp | 2 +-
hotspot/src/share/vm/runtime/monitorChunk.cpp | 2 +-
hotspot/src/share/vm/runtime/monitorChunk.hpp | 2 +-
hotspot/src/share/vm/runtime/mutex.hpp | 2 +-
hotspot/src/share/vm/runtime/os.cpp | 135 +++-
hotspot/src/share/vm/runtime/os.hpp | 37 +-
hotspot/src/share/vm/runtime/osThread.hpp | 2 +-
hotspot/src/share/vm/runtime/park.cpp | 2 +-
hotspot/src/share/vm/runtime/perfData.cpp | 12 +-
hotspot/src/share/vm/runtime/perfData.hpp | 6 +-
hotspot/src/share/vm/runtime/perfMemory.cpp | 8 +-
.../src/share/vm/runtime/reflectionUtils.cpp | 2 +-
hotspot/src/share/vm/runtime/safepoint.cpp | 7 +-
hotspot/src/share/vm/runtime/safepoint.hpp | 2 +-
.../src/share/vm/runtime/sharedRuntime.cpp | 28 +-
.../src/share/vm/runtime/sharedRuntime.hpp | 4 +-
.../share/vm/runtime/stubCodeGenerator.hpp | 2 +-
hotspot/src/share/vm/runtime/sweeper.cpp | 2 +-
hotspot/src/share/vm/runtime/task.hpp | 2 +-
hotspot/src/share/vm/runtime/thread.cpp | 86 ++-
hotspot/src/share/vm/runtime/thread.hpp | 30 +-
.../src/share/vm/runtime/unhandledOops.cpp | 2 +-
hotspot/src/share/vm/runtime/vframeArray.cpp | 2 +-
hotspot/src/share/vm/runtime/vframeArray.hpp | 2 +-
hotspot/src/share/vm/runtime/vframe_hp.cpp | 4 +-
hotspot/src/share/vm/runtime/vframe_hp.hpp | 4 +-
hotspot/src/share/vm/runtime/virtualspace.cpp | 10 +
hotspot/src/share/vm/runtime/vmStructs.cpp | 59 +-
hotspot/src/share/vm/runtime/vmThread.hpp | 2 +-
.../src/share/vm/runtime/vm_operations.hpp | 2 +-
.../src/share/vm/services/attachListener.cpp | 2 +-
.../src/share/vm/services/attachListener.hpp | 2 +-
.../share/vm/services/diagnosticArgument.cpp | 4 +-
.../share/vm/services/diagnosticArgument.hpp | 8 +-
.../share/vm/services/diagnosticFramework.hpp | 4 +-
hotspot/src/share/vm/services/gcNotifier.cpp | 2 +-
hotspot/src/share/vm/services/gcNotifier.hpp | 2 +-
hotspot/src/share/vm/services/heapDumper.cpp | 12 +-
.../share/vm/services/lowMemoryDetector.hpp | 4 +-
hotspot/src/share/vm/services/management.cpp | 2 +
hotspot/src/share/vm/services/memBaseline.cpp | 387 +++++++++++
hotspot/src/share/vm/services/memBaseline.hpp | 447 +++++++++++++
hotspot/src/share/vm/services/memPtr.cpp | 74 +++
hotspot/src/share/vm/services/memPtr.hpp | 509 +++++++++++++++
hotspot/src/share/vm/services/memPtrArray.hpp | 310 +++++++++
hotspot/src/share/vm/services/memRecorder.cpp | 162 +++++
hotspot/src/share/vm/services/memRecorder.hpp | 267 ++++++++
hotspot/src/share/vm/services/memReporter.cpp | 560 ++++++++++++++++
hotspot/src/share/vm/services/memReporter.hpp | 268 ++++++++
hotspot/src/share/vm/services/memSnapshot.cpp | 463 +++++++++++++
hotspot/src/share/vm/services/memSnapshot.hpp | 286 ++++++++
.../src/share/vm/services/memTrackWorker.cpp | 199 ++++++
.../src/share/vm/services/memTrackWorker.hpp | 74 +++
hotspot/src/share/vm/services/memTracker.cpp | 617 ++++++++++++++++++
hotspot/src/share/vm/services/memTracker.hpp | 384 +++++++++++
.../src/share/vm/services/memoryManager.cpp | 12 +-
.../src/share/vm/services/memoryManager.hpp | 2 +-
hotspot/src/share/vm/services/memoryPool.hpp | 2 +-
.../src/share/vm/services/memoryService.cpp | 4 +-
hotspot/src/share/vm/services/nmtDCmd.cpp | 172 +++++
hotspot/src/share/vm/services/nmtDCmd.hpp | 60 ++
.../src/share/vm/services/threadService.cpp | 10 +-
.../src/share/vm/services/threadService.hpp | 12 +-
hotspot/src/share/vm/utilities/array.cpp | 10 +-
hotspot/src/share/vm/utilities/array.hpp | 4 +-
hotspot/src/share/vm/utilities/bitMap.cpp | 8 +-
hotspot/src/share/vm/utilities/decoder.hpp | 2 +-
hotspot/src/share/vm/utilities/elfFile.cpp | 2 +-
hotspot/src/share/vm/utilities/elfFile.hpp | 2 +-
.../src/share/vm/utilities/elfStringTable.cpp | 2 +-
.../src/share/vm/utilities/elfStringTable.hpp | 2 +-
.../src/share/vm/utilities/elfSymbolTable.cpp | 2 +-
.../src/share/vm/utilities/elfSymbolTable.hpp | 2 +-
hotspot/src/share/vm/utilities/events.hpp | 2 +-
hotspot/src/share/vm/utilities/exceptions.hpp | 2 +-
.../src/share/vm/utilities/growableArray.cpp | 2 +-
.../src/share/vm/utilities/growableArray.hpp | 18 +-
hotspot/src/share/vm/utilities/hashtable.cpp | 115 ++--
hotspot/src/share/vm/utilities/hashtable.hpp | 80 +--
.../share/vm/utilities/hashtable.inline.hpp | 25 +-
hotspot/src/share/vm/utilities/histogram.cpp | 2 +-
hotspot/src/share/vm/utilities/histogram.hpp | 4 +-
hotspot/src/share/vm/utilities/intHisto.cpp | 2 +-
hotspot/src/share/vm/utilities/intHisto.hpp | 2 +-
hotspot/src/share/vm/utilities/numberSeq.cpp | 4 +-
hotspot/src/share/vm/utilities/numberSeq.hpp | 4 +-
hotspot/src/share/vm/utilities/ostream.cpp | 30 +-
hotspot/src/share/vm/utilities/stack.hpp | 33 +-
.../src/share/vm/utilities/stack.inline.hpp | 158 ++---
hotspot/src/share/vm/utilities/taskqueue.hpp | 150 +++--
hotspot/src/share/vm/utilities/vmError.cpp | 4 +
hotspot/src/share/vm/utilities/workgroup.cpp | 7 +-
hotspot/src/share/vm/utilities/workgroup.hpp | 4 +-
hotspot/src/share/vm/utilities/xmlstream.cpp | 8 +-
315 files changed, 7245 insertions(+), 1477 deletions(-)
create mode 100644 hotspot/src/share/vm/services/memBaseline.cpp
create mode 100644 hotspot/src/share/vm/services/memBaseline.hpp
create mode 100644 hotspot/src/share/vm/services/memPtr.cpp
create mode 100644 hotspot/src/share/vm/services/memPtr.hpp
create mode 100644 hotspot/src/share/vm/services/memPtrArray.hpp
create mode 100644 hotspot/src/share/vm/services/memRecorder.cpp
create mode 100644 hotspot/src/share/vm/services/memRecorder.hpp
create mode 100644 hotspot/src/share/vm/services/memReporter.cpp
create mode 100644 hotspot/src/share/vm/services/memReporter.hpp
create mode 100644 hotspot/src/share/vm/services/memSnapshot.cpp
create mode 100644 hotspot/src/share/vm/services/memSnapshot.hpp
create mode 100644 hotspot/src/share/vm/services/memTrackWorker.cpp
create mode 100644 hotspot/src/share/vm/services/memTrackWorker.hpp
create mode 100644 hotspot/src/share/vm/services/memTracker.cpp
create mode 100644 hotspot/src/share/vm/services/memTracker.hpp
create mode 100644 hotspot/src/share/vm/services/nmtDCmd.cpp
create mode 100644 hotspot/src/share/vm/services/nmtDCmd.hpp
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java
index bb296a509d2..0f4da3a9218 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java
@@ -41,10 +41,10 @@ public class BasicHashtable extends VMObject {
}
private static synchronized void initialize(TypeDataBase db) {
- Type type = db.lookupType("BasicHashtable");
+ Type type = db.lookupType("BasicHashtable");
tableSizeField = type.getCIntegerField("_table_size");
bucketsField = type.getAddressField("_buckets");
- bucketSize = db.lookupType("HashtableBucket").getSize();
+ bucketSize = db.lookupType("HashtableBucket").getSize();
}
// Fields
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java
index 192c1dd9fa0..0296dcbd651 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java
@@ -41,7 +41,7 @@ public class BasicHashtableEntry extends VMObject {
}
private static synchronized void initialize(TypeDataBase db) {
- Type type = db.lookupType("BasicHashtableEntry");
+ Type type = db.lookupType("BasicHashtableEntry");
hashField = type.getCIntegerField("_hash");
nextField = type.getAddressField("_next");
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java
index 3c2e0f965c2..70709f02b84 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java
@@ -40,7 +40,7 @@ public class Hashtable extends BasicHashtable {
private static synchronized void initialize(TypeDataBase db) {
// just to confirm that type exists
- Type type = db.lookupType("Hashtable");
+ Type type = db.lookupType("IntptrHashtable");
}
// derived class may return Class extends HashtableEntry>
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java
index 2e86b9a8318..44f78e49dd8 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java
@@ -39,7 +39,7 @@ public class HashtableBucket extends VMObject {
}
private static synchronized void initialize(TypeDataBase db) {
- Type type = db.lookupType("HashtableBucket");
+ Type type = db.lookupType("HashtableBucket");
entryField = type.getAddressField("_entry");
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java
index 73932a43033..38c5968720d 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java
@@ -41,7 +41,7 @@ public class HashtableEntry extends BasicHashtableEntry {
}
private static synchronized void initialize(TypeDataBase db) {
- Type type = db.lookupType("HashtableEntry");
+ Type type = db.lookupType("IntptrHashtableEntry");
literalField = type.getAddressField("_literal");
}
diff --git a/hotspot/make/bsd/makefiles/jvmg.make b/hotspot/make/bsd/makefiles/jvmg.make
index 8c56368d4dc..b5be2967edc 100644
--- a/hotspot/make/bsd/makefiles/jvmg.make
+++ b/hotspot/make/bsd/makefiles/jvmg.make
@@ -27,7 +27,9 @@
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
-CFLAGS += $(DEBUG_CFLAGS/BYFILE)
+
+# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
+CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
# Set the environment variable HOTSPARC_GENERIC to "true"
# to inhibit the effect of the previous line on CFLAGS.
diff --git a/hotspot/make/linux/makefiles/jvmg.make b/hotspot/make/linux/makefiles/jvmg.make
index db10608c142..3c0ae3a628e 100644
--- a/hotspot/make/linux/makefiles/jvmg.make
+++ b/hotspot/make/linux/makefiles/jvmg.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
@@ -27,7 +27,9 @@
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
-CFLAGS += $(DEBUG_CFLAGS/BYFILE)
+
+# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
+CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
# Set the environment variable HOTSPARC_GENERIC to "true"
# to inhibit the effect of the previous line on CFLAGS.
diff --git a/hotspot/make/solaris/makefiles/jvmg.make b/hotspot/make/solaris/makefiles/jvmg.make
index 8e1db865e33..821c0a13850 100644
--- a/hotspot/make/solaris/makefiles/jvmg.make
+++ b/hotspot/make/solaris/makefiles/jvmg.make
@@ -37,7 +37,8 @@ ifeq ($(COMPILER_REV_NUMERIC),508)
endif
endif
-CFLAGS += $(DEBUG_CFLAGS/BYFILE)
+# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
+CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
# Set the environment variable HOTSPARC_GENERIC to "true"
# to inhibit the effect of the previous line on CFLAGS.
diff --git a/hotspot/make/windows/makefiles/debug.make b/hotspot/make/windows/makefiles/debug.make
index 9f434729d76..36a12dc9de2 100644
--- a/hotspot/make/windows/makefiles/debug.make
+++ b/hotspot/make/windows/makefiles/debug.make
@@ -38,7 +38,8 @@ default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA wb
!include ../local.make
!include compile.make
-CXX_FLAGS=$(CXX_FLAGS) $(DEBUG_OPT_OPTION)
+# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
+CXX_FLAGS=$(CXX_FLAGS) $(DEBUG_OPT_OPTION) /D "_NMT_NOINLINE_"
!include $(WorkSpace)/make/windows/makefiles/vm.make
!include local.make
diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp
index f9b21acb464..0305b3df0de 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -440,7 +440,7 @@ void os::init_system_properties_values() {
// code needs to be changed accordingly.
// The next few definitions allow the code to be verbatim:
-#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n))
+#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n), mtInternal)
#define getenv(n) ::getenv(n)
/*
@@ -1913,11 +1913,11 @@ void os::dll_build_name(char* buffer, size_t buflen,
// release the storage
for (int i = 0 ; i < n ; i++) {
if (pelements[i] != NULL) {
- FREE_C_HEAP_ARRAY(char, pelements[i]);
+ FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
}
}
if (pelements != NULL) {
- FREE_C_HEAP_ARRAY(char*, pelements);
+ FREE_C_HEAP_ARRAY(char*, pelements, mtInternal);
}
} else {
snprintf(buffer, buflen, "%s/" JNI_LIB_PREFIX "%s" JNI_LIB_SUFFIX, pname, fname);
@@ -2766,7 +2766,7 @@ void bsd_wrap_code(char* base, size_t size) {
// All it does is to check if there are enough free pages
// left at the time of mmap(). This could be a potential
// problem.
-bool os::commit_memory(char* addr, size_t size, bool exec) {
+bool os::pd_commit_memory(char* addr, size_t size, bool exec) {
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
#ifdef __OpenBSD__
// XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD
@@ -2790,7 +2790,7 @@ bool os::commit_memory(char* addr, size_t size, bool exec) {
#endif
#endif
-bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
+bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
bool exec) {
#ifndef _ALLBSD_SOURCE
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
@@ -2806,7 +2806,7 @@ bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
return commit_memory(addr, size, exec);
}
-void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
+void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
#ifndef _ALLBSD_SOURCE
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
// We don't check the return value: madvise(MADV_HUGEPAGE) may not
@@ -2816,7 +2816,7 @@ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
#endif
}
-void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) {
+void os::pd_free_memory(char *addr, size_t bytes, size_t alignment_hint) {
::madvise(addr, bytes, MADV_DONTNEED);
}
@@ -2958,7 +2958,7 @@ os::Bsd::numa_interleave_memory_func_t os::Bsd::_numa_interleave_memory;
unsigned long* os::Bsd::_numa_all_nodes;
#endif
-bool os::uncommit_memory(char* addr, size_t size) {
+bool os::pd_uncommit_memory(char* addr, size_t size) {
#ifdef __OpenBSD__
// XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD
return ::mprotect(addr, size, PROT_NONE) == 0;
@@ -2969,7 +2969,7 @@ bool os::uncommit_memory(char* addr, size_t size) {
#endif
}
-bool os::create_stack_guard_pages(char* addr, size_t size) {
+bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
return os::commit_memory(addr, size);
}
@@ -3023,12 +3023,12 @@ static int anon_munmap(char * addr, size_t size) {
return ::munmap(addr, size) == 0;
}
-char* os::reserve_memory(size_t bytes, char* requested_addr,
+char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
size_t alignment_hint) {
return anon_mmap(requested_addr, bytes, (requested_addr != NULL));
}
-bool os::release_memory(char* addr, size_t size) {
+bool os::pd_release_memory(char* addr, size_t size) {
return anon_munmap(addr, size);
}
@@ -3331,7 +3331,7 @@ bool os::can_execute_large_page_memory() {
// Reserve memory at an arbitrary address, only if that area is
// available (and not reserved for something else).
-char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
+char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
const int max_tries = 10;
char* base[max_tries];
size_t size[max_tries];
@@ -4987,7 +4987,7 @@ int os::socket_available(int fd, jint *pbytes) {
}
// Map a block of memory.
-char* os::map_memory(int fd, const char* file_name, size_t file_offset,
+char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec) {
int prot;
@@ -5019,7 +5019,7 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset,
// Remap a block of memory.
-char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
+char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec) {
// same as map_memory() on this OS
@@ -5029,7 +5029,7 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
// Unmap a block of memory.
-bool os::unmap_memory(char* addr, size_t bytes) {
+bool os::pd_unmap_memory(char* addr, size_t bytes) {
return munmap(addr, bytes) == 0;
}
diff --git a/hotspot/src/os/bsd/vm/os_bsd.hpp b/hotspot/src/os/bsd/vm/os_bsd.hpp
index 271d1e291e9..bb8fe3f211e 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.hpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.hpp
@@ -312,7 +312,7 @@ public:
};
-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 ;
@@ -347,7 +347,7 @@ class PlatformEvent : public CHeapObj {
void SetAssociation (Thread * a) { _Assoc = a ; }
} ;
-class PlatformParker : public CHeapObj {
+class PlatformParker : public CHeapObj {
protected:
pthread_mutex_t _mutex [1] ;
pthread_cond_t _cond [1] ;
diff --git a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp
index c582a45315a..9980d4631a2 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp
@@ -95,7 +95,7 @@ inline bool os::allocate_stack_guard_pages() {
// On Bsd, reservations are made on a page by page basis, nothing to do.
-inline void os::split_reserved_memory(char *base, size_t size,
+inline void os::pd_split_reserved_memory(char *base, size_t size,
size_t split, bool realloc) {
}
diff --git a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp
index c93289e5909..e9db634135f 100644
--- a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp
@@ -126,7 +126,7 @@ static void save_memory_to_file(char* addr, size_t size) {
}
}
}
- FREE_C_HEAP_ARRAY(char, destfile);
+ FREE_C_HEAP_ARRAY(char, destfile, mtInternal);
}
@@ -153,7 +153,7 @@ static char* get_user_tmp_dir(const char* user) {
const char* tmpdir = os::get_temp_directory();
const char* perfdir = PERFDATA_NAME;
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
- char* dirname = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
// construct the path name to user specific tmp directory
snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
@@ -246,7 +246,7 @@ static char* get_user_name(uid_t uid) {
if (bufsize == -1)
bufsize = 1024;
- char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize);
+ char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
// POSIX interface to getpwuid_r is used on LINUX
struct passwd* p;
@@ -278,14 +278,14 @@ static char* get_user_name(uid_t uid) {
"pw_name zero length");
}
}
- FREE_C_HEAP_ARRAY(char, pwbuf);
+ FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
return NULL;
}
- char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1);
+ char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1, mtInternal);
strcpy(user_name, p->pw_name);
- FREE_C_HEAP_ARRAY(char, pwbuf);
+ FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
return user_name;
}
@@ -328,7 +328,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
// to determine the user name for the process id.
//
struct dirent* dentry;
- char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname));
+ char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal);
errno = 0;
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
@@ -338,7 +338,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
}
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
- strlen(tmpdirname) + strlen(dentry->d_name) + 2);
+ strlen(tmpdirname) + strlen(dentry->d_name) + 2, mtInternal);
strcpy(usrdir_name, tmpdirname);
strcat(usrdir_name, "/");
strcat(usrdir_name, dentry->d_name);
@@ -346,7 +346,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
DIR* subdirp = os::opendir(usrdir_name);
if (subdirp == NULL) {
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
continue;
}
@@ -357,13 +357,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
// symlink can be exploited.
//
if (!is_directory_secure(usrdir_name)) {
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
os::closedir(subdirp);
continue;
}
struct dirent* udentry;
- char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name));
+ char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal);
errno = 0;
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
@@ -372,7 +372,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
int result;
char* filename = NEW_C_HEAP_ARRAY(char,
- strlen(usrdir_name) + strlen(udentry->d_name) + 2);
+ strlen(usrdir_name) + strlen(udentry->d_name) + 2, mtInternal);
strcpy(filename, usrdir_name);
strcat(filename, "/");
@@ -381,13 +381,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
// don't follow symbolic links for the file
RESTARTABLE(::lstat(filename, &statbuf), result);
if (result == OS_ERR) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
continue;
}
// skip over files that are not regular files.
if (!S_ISREG(statbuf.st_mode)) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
continue;
}
@@ -397,23 +397,23 @@ static char* get_user_name_slow(int vmid, TRAPS) {
if (statbuf.st_ctime > oldest_ctime) {
char* user = strchr(dentry->d_name, '_') + 1;
- if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user);
- oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
+ if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user, mtInternal);
+ oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
strcpy(oldest_user, user);
oldest_ctime = statbuf.st_ctime;
}
}
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
}
}
os::closedir(subdirp);
- FREE_C_HEAP_ARRAY(char, udbuf);
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, udbuf, mtInternal);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
}
os::closedir(tmpdirp);
- FREE_C_HEAP_ARRAY(char, tdbuf);
+ FREE_C_HEAP_ARRAY(char, tdbuf, mtInternal);
return(oldest_user);
}
@@ -434,7 +434,7 @@ static char* get_sharedmem_filename(const char* dirname, int vmid) {
// add 2 for the file separator and a null terminator.
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
- char* name = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* name = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
snprintf(name, nbytes, "%s/%d", dirname, vmid);
return name;
@@ -472,7 +472,7 @@ static void remove_file(const char* path) {
static void remove_file(const char* dirname, const char* filename) {
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
- char* path = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
strcpy(path, dirname);
strcat(path, "/");
@@ -480,7 +480,7 @@ static void remove_file(const char* dirname, const char* filename) {
remove_file(path);
- FREE_C_HEAP_ARRAY(char, path);
+ FREE_C_HEAP_ARRAY(char, path, mtInternal);
}
@@ -517,7 +517,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
// opendir/readdir.
//
struct dirent* entry;
- char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname));
+ char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
errno = 0;
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
@@ -556,7 +556,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
errno = 0;
}
os::closedir(dirp);
- FREE_C_HEAP_ARRAY(char, dbuf);
+ FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
}
// make the user specific temporary directory. Returns true if
@@ -723,11 +723,11 @@ static char* mmap_create_shared(size_t size) {
fd = create_sharedmem_resources(dirname, filename, size);
- FREE_C_HEAP_ARRAY(char, user_name);
- FREE_C_HEAP_ARRAY(char, dirname);
+ FREE_C_HEAP_ARRAY(char, user_name, mtInternal);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
if (fd == -1) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
return NULL;
}
@@ -743,7 +743,7 @@ static char* mmap_create_shared(size_t size) {
warning("mmap failed - %s\n", strerror(errno));
}
remove_file(filename);
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
return NULL;
}
@@ -869,7 +869,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
// store file, we don't follow them when attaching either.
//
if (!is_directory_secure(dirname)) {
- FREE_C_HEAP_ARRAY(char, dirname);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
"Process not found");
}
@@ -884,9 +884,9 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
strcpy(rfilename, filename);
// free the c heap resources that are no longer needed
- if (luser != user) FREE_C_HEAP_ARRAY(char, luser);
- FREE_C_HEAP_ARRAY(char, dirname);
- FREE_C_HEAP_ARRAY(char, filename);
+ if (luser != user) FREE_C_HEAP_ARRAY(char, luser, mtInternal);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
// open the shared memory file for the give vmid
fd = open_sharedmem_file(rfilename, file_flags, CHECK);
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
index 53457ec8db9..ce7c71b9d43 100644
--- a/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
@@ -371,7 +371,7 @@ void os::init_system_properties_values() {
// code needs to be changed accordingly.
// The next few definitions allow the code to be verbatim:
-#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n))
+#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n), mtInternal)
#define getenv(n) ::getenv(n)
/*
@@ -639,7 +639,7 @@ void os::Linux::libpthread_init() {
size_t n = confstr(_CS_GNU_LIBC_VERSION, NULL, 0);
if (n > 0) {
- char *str = (char *)malloc(n);
+ char *str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBC_VERSION, str, n);
os::Linux::set_glibc_version(str);
} else {
@@ -652,7 +652,7 @@ void os::Linux::libpthread_init() {
n = confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, 0);
if (n > 0) {
- char *str = (char *)malloc(n);
+ char *str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
// Vanilla RH-9 (glibc 2.3.2) has a bug that confstr() always tells
// us "NPTL-0.29" even we are running with LinuxThreads. Check if this
@@ -1685,11 +1685,11 @@ void os::dll_build_name(char* buffer, size_t buflen,
// release the storage
for (int i = 0 ; i < n ; i++) {
if (pelements[i] != NULL) {
- FREE_C_HEAP_ARRAY(char, pelements[i]);
+ FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
}
}
if (pelements != NULL) {
- FREE_C_HEAP_ARRAY(char*, pelements);
+ FREE_C_HEAP_ARRAY(char*, pelements, mtInternal);
}
} else {
snprintf(buffer, buflen, "%s/lib%s.so", pname, fname);
@@ -2469,7 +2469,7 @@ void linux_wrap_code(char* base, size_t size) {
// All it does is to check if there are enough free pages
// left at the time of mmap(). This could be a potential
// problem.
-bool os::commit_memory(char* addr, size_t size, bool exec) {
+bool os::pd_commit_memory(char* addr, size_t size, bool exec) {
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
uintptr_t res = (uintptr_t) ::mmap(addr, size, prot,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
@@ -2492,7 +2492,7 @@ bool os::commit_memory(char* addr, size_t size, bool exec) {
#define MADV_HUGEPAGE 14
#endif
-bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
+bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
bool exec) {
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
@@ -2516,7 +2516,7 @@ bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
return false;
}
-void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
+void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
// We don't check the return value: madvise(MADV_HUGEPAGE) may not
// be supported or the memory may already be backed by huge pages.
@@ -2524,7 +2524,7 @@ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
}
}
-void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) {
+void os::pd_free_memory(char *addr, size_t bytes, size_t alignment_hint) {
// This method works by doing an mmap over an existing mmaping and effectively discarding
// the existing pages. However it won't work for SHM-based large pages that cannot be
// uncommitted at all. We don't do anything in this case to avoid creating a segment with
@@ -2646,7 +2646,7 @@ bool os::Linux::libnuma_init() {
if (numa_available() != -1) {
set_numa_all_nodes((unsigned long*)libnuma_dlsym(handle, "numa_all_nodes"));
// Create a cpu -> node mapping
- _cpu_to_node = new (ResourceObj::C_HEAP) GrowableArray(0, true);
+ _cpu_to_node = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(0, true);
rebuild_cpu_to_node_map();
return true;
}
@@ -2676,7 +2676,7 @@ void os::Linux::rebuild_cpu_to_node_map() {
cpu_to_node()->at_grow(cpu_num - 1);
size_t node_num = numa_get_groups_num();
- unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size);
+ unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size, mtInternal);
for (size_t i = 0; i < node_num; i++) {
if (numa_node_to_cpus(i, cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) {
for (size_t j = 0; j < cpu_map_valid_size; j++) {
@@ -2690,7 +2690,7 @@ void os::Linux::rebuild_cpu_to_node_map() {
}
}
}
- FREE_C_HEAP_ARRAY(unsigned long, cpu_map);
+ FREE_C_HEAP_ARRAY(unsigned long, cpu_map, mtInternal);
}
int os::Linux::get_node_by_cpu(int cpu_id) {
@@ -2709,7 +2709,7 @@ os::Linux::numa_tonode_memory_func_t os::Linux::_numa_tonode_memory;
os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory;
unsigned long* os::Linux::_numa_all_nodes;
-bool os::uncommit_memory(char* addr, size_t size) {
+bool os::pd_uncommit_memory(char* addr, size_t size) {
uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE,
MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0);
return res != (uintptr_t) MAP_FAILED;
@@ -2774,7 +2774,7 @@ bool get_stack_bounds(uintptr_t *bottom, uintptr_t *top) {
// munmap() the guard pages we don't leave a hole in the stack
// mapping. This only affects the main/initial thread, but guard
// against future OS changes
-bool os::create_stack_guard_pages(char* addr, size_t size) {
+bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
uintptr_t stack_extent, stack_base;
bool chk_bounds = NOT_DEBUG(os::Linux::is_initial_thread()) DEBUG_ONLY(true);
if (chk_bounds && get_stack_bounds(&stack_extent, &stack_base)) {
@@ -2847,12 +2847,12 @@ static int anon_munmap(char * addr, size_t size) {
return ::munmap(addr, size) == 0;
}
-char* os::reserve_memory(size_t bytes, char* requested_addr,
+char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
size_t alignment_hint) {
return anon_mmap(requested_addr, bytes, (requested_addr != NULL));
}
-bool os::release_memory(char* addr, size_t size) {
+bool os::pd_release_memory(char* addr, size_t size) {
return anon_munmap(addr, size);
}
@@ -3149,7 +3149,7 @@ bool os::can_execute_large_page_memory() {
// Reserve memory at an arbitrary address, only if that area is
// available (and not reserved for something else).
-char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
+char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
const int max_tries = 10;
char* base[max_tries];
size_t size[max_tries];
@@ -4671,7 +4671,7 @@ int os::socket_available(int fd, jint *pbytes) {
}
// Map a block of memory.
-char* os::map_memory(int fd, const char* file_name, size_t file_offset,
+char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec) {
int prot;
@@ -4701,7 +4701,7 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset,
// Remap a block of memory.
-char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
+char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec) {
// same as map_memory() on this OS
@@ -4711,7 +4711,7 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
// Unmap a block of memory.
-bool os::unmap_memory(char* addr, size_t bytes) {
+bool os::pd_unmap_memory(char* addr, size_t bytes) {
return munmap(addr, bytes) == 0;
}
diff --git a/hotspot/src/os/linux/vm/os_linux.hpp b/hotspot/src/os/linux/vm/os_linux.hpp
index 7c19517e21e..0f0fa214a04 100644
--- a/hotspot/src/os/linux/vm/os_linux.hpp
+++ b/hotspot/src/os/linux/vm/os_linux.hpp
@@ -287,7 +287,7 @@ public:
};
-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 ;
@@ -322,7 +322,7 @@ class PlatformEvent : public CHeapObj {
void SetAssociation (Thread * a) { _Assoc = a ; }
} ;
-class PlatformParker : public CHeapObj {
+class PlatformParker : public CHeapObj {
protected:
pthread_mutex_t _mutex [1] ;
pthread_cond_t _cond [1] ;
diff --git a/hotspot/src/os/linux/vm/os_linux.inline.hpp b/hotspot/src/os/linux/vm/os_linux.inline.hpp
index 566c0ad3168..c663c9b6961 100644
--- a/hotspot/src/os/linux/vm/os_linux.inline.hpp
+++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp
@@ -99,7 +99,7 @@ inline bool os::allocate_stack_guard_pages() {
// On Linux, reservations are made on a page by page basis, nothing to do.
-inline void os::split_reserved_memory(char *base, size_t size,
+inline void os::pd_split_reserved_memory(char *base, size_t size,
size_t split, bool realloc) {
}
diff --git a/hotspot/src/os/linux/vm/perfMemory_linux.cpp b/hotspot/src/os/linux/vm/perfMemory_linux.cpp
index 1cd430cfbc7..8839aac6c10 100644
--- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp
+++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp
@@ -126,7 +126,7 @@ static void save_memory_to_file(char* addr, size_t size) {
}
}
}
- FREE_C_HEAP_ARRAY(char, destfile);
+ FREE_C_HEAP_ARRAY(char, destfile, mtInternal);
}
@@ -153,7 +153,7 @@ static char* get_user_tmp_dir(const char* user) {
const char* tmpdir = os::get_temp_directory();
const char* perfdir = PERFDATA_NAME;
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
- char* dirname = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
// construct the path name to user specific tmp directory
snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
@@ -246,7 +246,7 @@ static char* get_user_name(uid_t uid) {
if (bufsize == -1)
bufsize = 1024;
- char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize);
+ char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
// POSIX interface to getpwuid_r is used on LINUX
struct passwd* p;
@@ -278,14 +278,14 @@ static char* get_user_name(uid_t uid) {
"pw_name zero length");
}
}
- FREE_C_HEAP_ARRAY(char, pwbuf);
+ FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
return NULL;
}
- char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1);
+ char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1, mtInternal);
strcpy(user_name, p->pw_name);
- FREE_C_HEAP_ARRAY(char, pwbuf);
+ FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
return user_name;
}
@@ -328,7 +328,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
// to determine the user name for the process id.
//
struct dirent* dentry;
- char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname));
+ char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal);
errno = 0;
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
@@ -338,7 +338,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
}
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
- strlen(tmpdirname) + strlen(dentry->d_name) + 2);
+ strlen(tmpdirname) + strlen(dentry->d_name) + 2, mtInternal);
strcpy(usrdir_name, tmpdirname);
strcat(usrdir_name, "/");
strcat(usrdir_name, dentry->d_name);
@@ -346,7 +346,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
DIR* subdirp = os::opendir(usrdir_name);
if (subdirp == NULL) {
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
continue;
}
@@ -357,13 +357,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
// symlink can be exploited.
//
if (!is_directory_secure(usrdir_name)) {
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
os::closedir(subdirp);
continue;
}
struct dirent* udentry;
- char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name));
+ char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal);
errno = 0;
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
@@ -372,7 +372,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
int result;
char* filename = NEW_C_HEAP_ARRAY(char,
- strlen(usrdir_name) + strlen(udentry->d_name) + 2);
+ strlen(usrdir_name) + strlen(udentry->d_name) + 2, mtInternal);
strcpy(filename, usrdir_name);
strcat(filename, "/");
@@ -381,13 +381,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
// don't follow symbolic links for the file
RESTARTABLE(::lstat(filename, &statbuf), result);
if (result == OS_ERR) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
continue;
}
// skip over files that are not regular files.
if (!S_ISREG(statbuf.st_mode)) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
continue;
}
@@ -397,23 +397,23 @@ static char* get_user_name_slow(int vmid, TRAPS) {
if (statbuf.st_ctime > oldest_ctime) {
char* user = strchr(dentry->d_name, '_') + 1;
- if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user);
- oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
+ if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user, mtInternal);
+ oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
strcpy(oldest_user, user);
oldest_ctime = statbuf.st_ctime;
}
}
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
}
}
os::closedir(subdirp);
- FREE_C_HEAP_ARRAY(char, udbuf);
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, udbuf, mtInternal);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
}
os::closedir(tmpdirp);
- FREE_C_HEAP_ARRAY(char, tdbuf);
+ FREE_C_HEAP_ARRAY(char, tdbuf, mtInternal);
return(oldest_user);
}
@@ -434,7 +434,7 @@ static char* get_sharedmem_filename(const char* dirname, int vmid) {
// add 2 for the file separator and a null terminator.
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
- char* name = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* name = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
snprintf(name, nbytes, "%s/%d", dirname, vmid);
return name;
@@ -472,7 +472,7 @@ static void remove_file(const char* path) {
static void remove_file(const char* dirname, const char* filename) {
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
- char* path = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
strcpy(path, dirname);
strcat(path, "/");
@@ -480,7 +480,7 @@ static void remove_file(const char* dirname, const char* filename) {
remove_file(path);
- FREE_C_HEAP_ARRAY(char, path);
+ FREE_C_HEAP_ARRAY(char, path, mtInternal);
}
@@ -517,7 +517,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
// opendir/readdir.
//
struct dirent* entry;
- char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname));
+ char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
errno = 0;
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
@@ -556,7 +556,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
errno = 0;
}
os::closedir(dirp);
- FREE_C_HEAP_ARRAY(char, dbuf);
+ FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
}
// make the user specific temporary directory. Returns true if
@@ -723,11 +723,11 @@ static char* mmap_create_shared(size_t size) {
fd = create_sharedmem_resources(dirname, filename, size);
- FREE_C_HEAP_ARRAY(char, user_name);
- FREE_C_HEAP_ARRAY(char, dirname);
+ FREE_C_HEAP_ARRAY(char, user_name, mtInternal);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
if (fd == -1) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
return NULL;
}
@@ -743,7 +743,7 @@ static char* mmap_create_shared(size_t size) {
warning("mmap failed - %s\n", strerror(errno));
}
remove_file(filename);
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
return NULL;
}
@@ -869,7 +869,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
// store file, we don't follow them when attaching either.
//
if (!is_directory_secure(dirname)) {
- FREE_C_HEAP_ARRAY(char, dirname);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
"Process not found");
}
@@ -884,9 +884,9 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
strcpy(rfilename, filename);
// free the c heap resources that are no longer needed
- if (luser != user) FREE_C_HEAP_ARRAY(char, luser);
- FREE_C_HEAP_ARRAY(char, dirname);
- FREE_C_HEAP_ARRAY(char, filename);
+ if (luser != user) FREE_C_HEAP_ARRAY(char, luser, mtInternal);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
// open the shared memory file for the give vmid
fd = open_sharedmem_file(rfilename, file_flags, CHECK);
diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp
index 9f05a74a4a0..3e49b8b9ddd 100644
--- a/hotspot/src/os/posix/vm/os_posix.cpp
+++ b/hotspot/src/os/posix/vm/os_posix.cpp
@@ -23,6 +23,7 @@
*/
#include "prims/jvm.h"
+#include "runtime/frame.inline.hpp"
#include "runtime/os.hpp"
#include "utilities/vmError.hpp"
@@ -61,6 +62,23 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char*
VMError::report_coredump_status(buffer, success);
}
+address os::get_caller_pc(int n) {
+#ifdef _NMT_NOINLINE_
+ n ++;
+#endif
+ frame fr = os::current_frame();
+ while (n > 0 && fr.pc() &&
+ !os::is_first_C_frame(&fr) && fr.sender_pc()) {
+ fr = os::get_sender_for_C_frame(&fr);
+ n --;
+ }
+ if (n == 0) {
+ return fr.pc();
+ } else {
+ return NULL;
+ }
+}
+
int os::get_last_error() {
return errno;
}
diff --git a/hotspot/src/os/solaris/dtrace/hs_private.d b/hotspot/src/os/solaris/dtrace/hs_private.d
index 23463a409b3..df395e5c045 100644
--- a/hotspot/src/os/solaris/dtrace/hs_private.d
+++ b/hotspot/src/os/solaris/dtrace/hs_private.d
@@ -23,7 +23,6 @@
*/
provider hs_private {
- probe hashtable__new_entry(void*, uintptr_t, void*);
probe safepoint__begin();
probe safepoint__end();
probe cms__initmark__begin();
diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp
index c3389a47764..1d241d650e8 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp
@@ -546,7 +546,7 @@ static bool find_processors_in_pset(psetid_t pset,
// Find the number of processors in the processor set.
if (pset_info(pset, NULL, id_length, NULL) == 0) {
// Make up an array to hold their ids.
- *id_array = NEW_C_HEAP_ARRAY(processorid_t, *id_length);
+ *id_array = NEW_C_HEAP_ARRAY(processorid_t, *id_length, mtInternal);
// Fill in the array with their processor ids.
if (pset_info(pset, NULL, id_length, *id_array) == 0) {
result = true;
@@ -577,7 +577,7 @@ static bool find_processors_online(processorid_t** id_array,
// Find the number of processors online.
*id_length = sysconf(_SC_NPROCESSORS_ONLN);
// Make up an array to hold their ids.
- *id_array = NEW_C_HEAP_ARRAY(processorid_t, *id_length);
+ *id_array = NEW_C_HEAP_ARRAY(processorid_t, *id_length, mtInternal);
// Processors need not be numbered consecutively.
long found = 0;
processorid_t next = 0;
@@ -629,7 +629,7 @@ static bool assign_distribution(processorid_t* id_array,
// The next id, to limit loops.
const processorid_t limit_id = max_id + 1;
// Make up markers for available processors.
- bool* available_id = NEW_C_HEAP_ARRAY(bool, limit_id);
+ bool* available_id = NEW_C_HEAP_ARRAY(bool, limit_id, mtInternal);
for (uint c = 0; c < limit_id; c += 1) {
available_id[c] = false;
}
@@ -666,7 +666,7 @@ static bool assign_distribution(processorid_t* id_array,
}
}
if (available_id != NULL) {
- FREE_C_HEAP_ARRAY(bool, available_id);
+ FREE_C_HEAP_ARRAY(bool, available_id, mtInternal);
}
return true;
}
@@ -698,7 +698,7 @@ bool os::distribute_processes(uint length, uint* distribution) {
}
}
if (id_array != NULL) {
- FREE_C_HEAP_ARRAY(processorid_t, id_array);
+ FREE_C_HEAP_ARRAY(processorid_t, id_array, mtInternal);
}
return result;
}
@@ -771,8 +771,8 @@ void os::init_system_properties_values() {
// code needs to be changed accordingly.
// The next few definitions allow the code to be verbatim:
-#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n))
-#define free(p) FREE_C_HEAP_ARRAY(char, p)
+#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n), mtInternal)
+#define free(p) FREE_C_HEAP_ARRAY(char, p, mtInternal)
#define getenv(n) ::getenv(n)
#define EXTENSIONS_DIR "/lib/ext"
@@ -1927,11 +1927,11 @@ void os::dll_build_name(char* buffer, size_t buflen,
// release the storage
for (int i = 0 ; i < n ; i++) {
if (pelements[i] != NULL) {
- FREE_C_HEAP_ARRAY(char, pelements[i]);
+ FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
}
}
if (pelements != NULL) {
- FREE_C_HEAP_ARRAY(char*, pelements);
+ FREE_C_HEAP_ARRAY(char*, pelements, mtInternal);
}
} else {
snprintf(buffer, buflen, "%s/lib%s.so", pname, fname);
@@ -2662,17 +2662,17 @@ void os::Solaris::init_signal_mem() {
// pending_signals has one int per signal
// The additional signal is for SIGEXIT - exit signal to signal_thread
- pending_signals = (jint *)os::malloc(sizeof(jint) * (Sigexit+1));
+ pending_signals = (jint *)os::malloc(sizeof(jint) * (Sigexit+1), mtInternal);
memset(pending_signals, 0, (sizeof(jint) * (Sigexit+1)));
if (UseSignalChaining) {
chainedsigactions = (struct sigaction *)malloc(sizeof(struct sigaction)
- * (Maxsignum + 1));
+ * (Maxsignum + 1), mtInternal);
memset(chainedsigactions, 0, (sizeof(struct sigaction) * (Maxsignum + 1)));
- preinstalled_sigs = (int *)os::malloc(sizeof(int) * (Maxsignum + 1));
+ preinstalled_sigs = (int *)os::malloc(sizeof(int) * (Maxsignum + 1), mtInternal);
memset(preinstalled_sigs, 0, (sizeof(int) * (Maxsignum + 1)));
}
- ourSigFlags = (int*)malloc(sizeof(int) * (Maxsignum + 1 ));
+ ourSigFlags = (int*)malloc(sizeof(int) * (Maxsignum + 1 ), mtInternal);
memset(ourSigFlags, 0, sizeof(int) * (Maxsignum + 1));
}
@@ -2760,7 +2760,7 @@ int os::vm_allocation_granularity() {
return page_size;
}
-bool os::commit_memory(char* addr, size_t bytes, bool exec) {
+bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) {
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
size_t size = bytes;
char *res = Solaris::mmap_chunk(addr, size, MAP_PRIVATE|MAP_FIXED, prot);
@@ -2773,7 +2773,7 @@ bool os::commit_memory(char* addr, size_t bytes, bool exec) {
return false;
}
-bool os::commit_memory(char* addr, size_t bytes, size_t alignment_hint,
+bool os::pd_commit_memory(char* addr, size_t bytes, size_t alignment_hint,
bool exec) {
if (commit_memory(addr, bytes, exec)) {
if (UseMPSS && alignment_hint > (size_t)vm_page_size()) {
@@ -2803,14 +2803,14 @@ bool os::commit_memory(char* addr, size_t bytes, size_t alignment_hint,
}
// Uncommit the pages in a specified region.
-void os::free_memory(char* addr, size_t bytes, size_t alignment_hint) {
+void os::pd_free_memory(char* addr, size_t bytes, size_t alignment_hint) {
if (madvise(addr, bytes, MADV_FREE) < 0) {
debug_only(warning("MADV_FREE failed."));
return;
}
}
-bool os::create_stack_guard_pages(char* addr, size_t size) {
+bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
return os::commit_memory(addr, size);
}
@@ -2819,7 +2819,7 @@ bool os::remove_stack_guard_pages(char* addr, size_t size) {
}
// Change the page size in a given range.
-void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
+void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned.");
assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned.");
if (UseLargePages && UseMPSS) {
@@ -3006,7 +3006,7 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info
return end;
}
-bool os::uncommit_memory(char* addr, size_t bytes) {
+bool os::pd_uncommit_memory(char* addr, size_t bytes) {
size_t size = bytes;
// Map uncommitted pages PROT_NONE so we fail early if we touch an
// uncommitted page. Otherwise, the read/write might succeed if we
@@ -3045,7 +3045,7 @@ char* os::Solaris::anon_mmap(char* requested_addr, size_t bytes, size_t alignmen
return mmap_chunk(addr, bytes, flags, PROT_NONE);
}
-char* os::reserve_memory(size_t bytes, char* requested_addr, size_t alignment_hint) {
+char* os::pd_reserve_memory(size_t bytes, char* requested_addr, size_t alignment_hint) {
char* addr = Solaris::anon_mmap(requested_addr, bytes, alignment_hint, (requested_addr != NULL));
guarantee(requested_addr == NULL || requested_addr == addr,
@@ -3056,7 +3056,7 @@ char* os::reserve_memory(size_t bytes, char* requested_addr, size_t alignment_hi
// Reserve memory at an arbitrary address, only if that area is
// available (and not reserved for something else).
-char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
+char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
const int max_tries = 10;
char* base[max_tries];
size_t size[max_tries];
@@ -3178,7 +3178,7 @@ char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
return (i < max_tries) ? requested_addr : NULL;
}
-bool os::release_memory(char* addr, size_t bytes) {
+bool os::pd_release_memory(char* addr, size_t bytes) {
size_t size = bytes;
return munmap(addr, size) == 0;
}
@@ -4792,7 +4792,7 @@ bool isT2_libthread() {
lwpSize = 16*1024;
for (;;) {
::lseek64 (lwpFile, 0, SEEK_SET);
- lwpArray = (prheader_t *)NEW_C_HEAP_ARRAY(char, lwpSize);
+ lwpArray = (prheader_t *)NEW_C_HEAP_ARRAY(char, lwpSize, mtInternal);
if (::read(lwpFile, lwpArray, lwpSize) < 0) {
if (ThreadPriorityVerbose) warning("Error reading /proc/self/lstatus\n");
break;
@@ -4810,10 +4810,10 @@ bool isT2_libthread() {
break;
}
lwpSize = lwpArray->pr_nent * lwpArray->pr_entsize;
- FREE_C_HEAP_ARRAY(char, lwpArray); // retry.
+ FREE_C_HEAP_ARRAY(char, lwpArray, mtInternal); // retry.
}
- FREE_C_HEAP_ARRAY(char, lwpArray);
+ FREE_C_HEAP_ARRAY(char, lwpArray, mtInternal);
::close (lwpFile);
if (ThreadPriorityVerbose) {
if (isT2) tty->print_cr("We are running with a T2 libthread\n");
@@ -5137,9 +5137,9 @@ jint os::init_2(void) {
UseNUMA = false;
} else {
size_t lgrp_limit = os::numa_get_groups_num();
- int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit);
+ int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit, mtInternal);
size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit);
- FREE_C_HEAP_ARRAY(int, lgrp_ids);
+ FREE_C_HEAP_ARRAY(int, lgrp_ids, mtInternal);
if (lgrp_num < 2) {
// There's only one locality group, disable NUMA.
UseNUMA = false;
@@ -5485,7 +5485,7 @@ int os::available(int fd, jlong *bytes) {
}
// Map a block of memory.
-char* os::map_memory(int fd, const char* file_name, size_t file_offset,
+char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec) {
int prot;
@@ -5517,7 +5517,7 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset,
// Remap a block of memory.
-char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
+char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec) {
// same as map_memory() on this OS
@@ -5527,7 +5527,7 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
// Unmap a block of memory.
-bool os::unmap_memory(char* addr, size_t bytes) {
+bool os::pd_unmap_memory(char* addr, size_t bytes) {
return munmap(addr, bytes) == 0;
}
diff --git a/hotspot/src/os/solaris/vm/os_solaris.hpp b/hotspot/src/os/solaris/vm/os_solaris.hpp
index 340aa4b7775..174f2529dbe 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.hpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.hpp
@@ -346,7 +346,7 @@ class Solaris {
};
-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 ;
@@ -383,7 +383,7 @@ class PlatformEvent : public CHeapObj {
void unpark () ;
} ;
-class PlatformParker : public CHeapObj {
+class PlatformParker : public CHeapObj {
protected:
mutex_t _mutex [1] ;
cond_t _cond [1] ;
diff --git a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp
index 7b63badc434..2468100fc43 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp
@@ -71,7 +71,7 @@ inline bool os::allocate_stack_guard_pages() {
// On Solaris, reservations are made on a page by page basis, nothing to do.
-inline void os::split_reserved_memory(char *base, size_t size,
+inline void os::pd_split_reserved_memory(char *base, size_t size,
size_t split, bool realloc) {
}
diff --git a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
index 1d1ff260cd8..c841ff8a1b6 100644
--- a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
@@ -128,7 +128,7 @@ static void save_memory_to_file(char* addr, size_t size) {
}
}
}
- FREE_C_HEAP_ARRAY(char, destfile);
+ FREE_C_HEAP_ARRAY(char, destfile, mtInternal);
}
@@ -155,7 +155,7 @@ static char* get_user_tmp_dir(const char* user) {
const char* tmpdir = os::get_temp_directory();
const char* perfdir = PERFDATA_NAME;
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
- char* dirname = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
// construct the path name to user specific tmp directory
snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
@@ -248,7 +248,7 @@ static char* get_user_name(uid_t uid) {
if (bufsize == -1)
bufsize = 1024;
- char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize);
+ char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
#ifdef _GNU_SOURCE
struct passwd* p = NULL;
@@ -269,14 +269,14 @@ static char* get_user_name(uid_t uid) {
"pw_name zero length");
}
}
- FREE_C_HEAP_ARRAY(char, pwbuf);
+ FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
return NULL;
}
- char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1);
+ char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1, mtInternal);
strcpy(user_name, p->pw_name);
- FREE_C_HEAP_ARRAY(char, pwbuf);
+ FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
return user_name;
}
@@ -319,7 +319,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
// to determine the user name for the process id.
//
struct dirent* dentry;
- char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname));
+ char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal);
errno = 0;
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
@@ -329,7 +329,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
}
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
- strlen(tmpdirname) + strlen(dentry->d_name) + 2);
+ strlen(tmpdirname) + strlen(dentry->d_name) + 2, mtInternal);
strcpy(usrdir_name, tmpdirname);
strcat(usrdir_name, "/");
strcat(usrdir_name, dentry->d_name);
@@ -337,7 +337,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
DIR* subdirp = os::opendir(usrdir_name);
if (subdirp == NULL) {
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
continue;
}
@@ -348,13 +348,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
// symlink can be exploited.
//
if (!is_directory_secure(usrdir_name)) {
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
os::closedir(subdirp);
continue;
}
struct dirent* udentry;
- char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name));
+ char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal);
errno = 0;
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
@@ -363,7 +363,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
int result;
char* filename = NEW_C_HEAP_ARRAY(char,
- strlen(usrdir_name) + strlen(udentry->d_name) + 2);
+ strlen(usrdir_name) + strlen(udentry->d_name) + 2, mtInternal);
strcpy(filename, usrdir_name);
strcat(filename, "/");
@@ -372,13 +372,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
// don't follow symbolic links for the file
RESTARTABLE(::lstat(filename, &statbuf), result);
if (result == OS_ERR) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
continue;
}
// skip over files that are not regular files.
if (!S_ISREG(statbuf.st_mode)) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
continue;
}
@@ -388,23 +388,23 @@ static char* get_user_name_slow(int vmid, TRAPS) {
if (statbuf.st_ctime > oldest_ctime) {
char* user = strchr(dentry->d_name, '_') + 1;
- if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user);
- oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
+ if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user, mtInternal);
+ oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
strcpy(oldest_user, user);
oldest_ctime = statbuf.st_ctime;
}
}
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
}
}
os::closedir(subdirp);
- FREE_C_HEAP_ARRAY(char, udbuf);
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, udbuf, mtInternal);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
}
os::closedir(tmpdirp);
- FREE_C_HEAP_ARRAY(char, tdbuf);
+ FREE_C_HEAP_ARRAY(char, tdbuf, mtInternal);
return(oldest_user);
}
@@ -471,7 +471,7 @@ static char* get_sharedmem_filename(const char* dirname, int vmid) {
// add 2 for the file separator and a NULL terminator.
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
- char* name = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* name = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
snprintf(name, nbytes, "%s/%d", dirname, vmid);
return name;
@@ -509,7 +509,7 @@ static void remove_file(const char* path) {
static void remove_file(const char* dirname, const char* filename) {
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
- char* path = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
strcpy(path, dirname);
strcat(path, "/");
@@ -517,7 +517,7 @@ static void remove_file(const char* dirname, const char* filename) {
remove_file(path);
- FREE_C_HEAP_ARRAY(char, path);
+ FREE_C_HEAP_ARRAY(char, path, mtInternal);
}
@@ -554,7 +554,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
// opendir/readdir.
//
struct dirent* entry;
- char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname));
+ char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
errno = 0;
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
@@ -593,7 +593,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
errno = 0;
}
os::closedir(dirp);
- FREE_C_HEAP_ARRAY(char, dbuf);
+ FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
}
// make the user specific temporary directory. Returns true if
@@ -738,11 +738,11 @@ static char* mmap_create_shared(size_t size) {
fd = create_sharedmem_resources(dirname, filename, size);
- FREE_C_HEAP_ARRAY(char, user_name);
- FREE_C_HEAP_ARRAY(char, dirname);
+ FREE_C_HEAP_ARRAY(char, user_name, mtInternal);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
if (fd == -1) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
return NULL;
}
@@ -758,7 +758,7 @@ static char* mmap_create_shared(size_t size) {
warning("mmap failed - %s\n", strerror(errno));
}
remove_file(filename);
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
return NULL;
}
@@ -884,7 +884,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
// store file, we don't follow them when attaching either.
//
if (!is_directory_secure(dirname)) {
- FREE_C_HEAP_ARRAY(char, dirname);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
"Process not found");
}
@@ -899,9 +899,9 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
strcpy(rfilename, filename);
// free the c heap resources that are no longer needed
- if (luser != user) FREE_C_HEAP_ARRAY(char, luser);
- FREE_C_HEAP_ARRAY(char, dirname);
- FREE_C_HEAP_ARRAY(char, filename);
+ if (luser != user) FREE_C_HEAP_ARRAY(char, luser, mtInternal);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
// open the shared memory file for the give vmid
fd = open_sharedmem_file(rfilename, file_flags, CHECK);
diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp
index 440b8026233..5534a1ea0a1 100644
--- a/hotspot/src/os/windows/vm/os_windows.cpp
+++ b/hotspot/src/os/windows/vm/os_windows.cpp
@@ -96,7 +96,6 @@
#include
#include // For _beginthreadex(), _endthreadex()
#include // For os::dll_address_to_function_name
-
/* for enumerating dll libraries */
#include
@@ -214,13 +213,13 @@ void os::init_system_properties_values() {
}
}
- home_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + 1);
+ home_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + 1, mtInternal);
if (home_path == NULL)
return;
strcpy(home_path, home_dir);
Arguments::set_java_home(home_path);
- dll_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + strlen(bin) + 1);
+ dll_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + strlen(bin) + 1, mtInternal);
if (dll_path == NULL)
return;
strcpy(dll_path, home_dir);
@@ -251,7 +250,7 @@ void os::init_system_properties_values() {
char *path_str = ::getenv("PATH");
library_path = NEW_C_HEAP_ARRAY(char, MAX_PATH * 5 + sizeof(PACKAGE_DIR) +
- sizeof(BIN_DIR) + (path_str ? strlen(path_str) : 0) + 10);
+ sizeof(BIN_DIR) + (path_str ? strlen(path_str) : 0) + 10, mtInternal);
library_path[0] = '\0';
@@ -280,7 +279,7 @@ void os::init_system_properties_values() {
strcat(library_path, ";.");
Arguments::set_library_path(library_path);
- FREE_C_HEAP_ARRAY(char, library_path);
+ FREE_C_HEAP_ARRAY(char, library_path, mtInternal);
}
/* Default extensions directory */
@@ -300,7 +299,7 @@ void os::init_system_properties_values() {
{
#define ENDORSED_DIR "\\lib\\endorsed"
size_t len = strlen(Arguments::get_java_home()) + sizeof(ENDORSED_DIR);
- char * buf = NEW_C_HEAP_ARRAY(char, len);
+ char * buf = NEW_C_HEAP_ARRAY(char, len, mtInternal);
sprintf(buf, "%s%s", Arguments::get_java_home(), ENDORSED_DIR);
Arguments::set_endorsed_dirs(buf);
#undef ENDORSED_DIR
@@ -324,6 +323,23 @@ extern "C" void breakpoint() {
os::breakpoint();
}
+/*
+ * RtlCaptureStackBackTrace Windows API may not exist prior to Windows XP.
+ * So far, this method is only used by Native Memory Tracking, which is
+ * only supported on Windows XP or later.
+ */
+address os::get_caller_pc(int n) {
+#ifdef _NMT_NOINLINE_
+ n ++;
+#endif
+ address pc;
+ if (os::Kernel32Dll::RtlCaptureStackBackTrace(n + 1, 1, (PVOID*)&pc, NULL) == 1) {
+ return pc;
+ }
+ return NULL;
+}
+
+
// os::current_stack_base()
//
// Returns the base of the stack, which is the stack's
@@ -1014,7 +1030,7 @@ DIR *
os::opendir(const char *dirname)
{
assert(dirname != NULL, "just checking"); // hotspot change
- DIR *dirp = (DIR *)malloc(sizeof(DIR));
+ DIR *dirp = (DIR *)malloc(sizeof(DIR), mtInternal);
DWORD fattr; // hotspot change
char alt_dirname[4] = { 0, 0, 0, 0 };
@@ -1036,9 +1052,9 @@ os::opendir(const char *dirname)
dirname = alt_dirname;
}
- dirp->path = (char *)malloc(strlen(dirname) + 5);
+ dirp->path = (char *)malloc(strlen(dirname) + 5, mtInternal);
if (dirp->path == 0) {
- free(dirp);
+ free(dirp, mtInternal);
errno = ENOMEM;
return 0;
}
@@ -1046,13 +1062,13 @@ os::opendir(const char *dirname)
fattr = GetFileAttributes(dirp->path);
if (fattr == 0xffffffff) {
- free(dirp->path);
- free(dirp);
+ free(dirp->path, mtInternal);
+ free(dirp, mtInternal);
errno = ENOENT;
return 0;
} else if ((fattr & FILE_ATTRIBUTE_DIRECTORY) == 0) {
- free(dirp->path);
- free(dirp);
+ free(dirp->path, mtInternal);
+ free(dirp, mtInternal);
errno = ENOTDIR;
return 0;
}
@@ -1070,8 +1086,8 @@ os::opendir(const char *dirname)
dirp->handle = FindFirstFile(dirp->path, &dirp->find_data);
if (dirp->handle == INVALID_HANDLE_VALUE) {
if (GetLastError() != ERROR_FILE_NOT_FOUND) {
- free(dirp->path);
- free(dirp);
+ free(dirp->path, mtInternal);
+ free(dirp, mtInternal);
errno = EACCES;
return 0;
}
@@ -1114,8 +1130,8 @@ os::closedir(DIR *dirp)
}
dirp->handle = INVALID_HANDLE_VALUE;
}
- free(dirp->path);
- free(dirp);
+ free(dirp->path, mtInternal);
+ free(dirp, mtInternal);
return 0;
}
@@ -1176,11 +1192,11 @@ void os::dll_build_name(char *buffer, size_t buflen,
// release the storage
for (int i = 0 ; i < n ; i++) {
if (pelements[i] != NULL) {
- FREE_C_HEAP_ARRAY(char, pelements[i]);
+ FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
}
}
if (pelements != NULL) {
- FREE_C_HEAP_ARRAY(char*, pelements);
+ FREE_C_HEAP_ARRAY(char*, pelements, mtInternal);
}
} else {
jio_snprintf(buffer, buflen, "%s\\%s.dll", pname, fname);
@@ -2637,7 +2653,7 @@ private:
void free_node_list() {
if (_numa_used_node_list != NULL) {
- FREE_C_HEAP_ARRAY(int, _numa_used_node_list);
+ FREE_C_HEAP_ARRAY(int, _numa_used_node_list, mtInternal);
}
}
@@ -2659,7 +2675,7 @@ public:
ULONG highest_node_number;
if (!os::Kernel32Dll::GetNumaHighestNodeNumber(&highest_node_number)) return false;
free_node_list();
- _numa_used_node_list = NEW_C_HEAP_ARRAY(int, highest_node_number + 1);
+ _numa_used_node_list = NEW_C_HEAP_ARRAY(int, highest_node_number + 1, mtInternal);
for (unsigned int i = 0; i <= highest_node_number; i++) {
ULONGLONG proc_mask_numa_node;
if (!os::Kernel32Dll::GetNumaNodeProcessorMask(i, &proc_mask_numa_node)) return false;
@@ -2918,7 +2934,7 @@ void os::large_page_init() {
// On win32, one cannot release just a part of reserved memory, it's an
// all or nothing deal. When we split a reservation, we must break the
// reservation into two reservations.
-void os::split_reserved_memory(char *base, size_t size, size_t split,
+void os::pd_split_reserved_memory(char *base, size_t size, size_t split,
bool realloc) {
if (size > 0) {
release_memory(base, size);
@@ -2931,7 +2947,7 @@ void os::split_reserved_memory(char *base, size_t size, size_t split,
}
}
-char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
+char* os::pd_reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
assert((size_t)addr % os::vm_allocation_granularity() == 0,
"reserve alignment");
assert(bytes % os::vm_allocation_granularity() == 0, "reserve block size");
@@ -2964,7 +2980,7 @@ char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
// Reserve memory at an arbitrary address, only if that area is
// available (and not reserved for something else).
-char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
+char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
// Windows os::reserve_memory() fails of the requested address range is
// not avilable.
return reserve_memory(bytes, requested_addr);
@@ -3027,7 +3043,7 @@ bool os::release_memory_special(char* base, size_t bytes) {
void os::print_statistics() {
}
-bool os::commit_memory(char* addr, size_t bytes, bool exec) {
+bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) {
if (bytes == 0) {
// Don't bother the OS with noops.
return true;
@@ -3075,26 +3091,26 @@ bool os::commit_memory(char* addr, size_t bytes, bool exec) {
return true;
}
-bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
+bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
bool exec) {
return commit_memory(addr, size, exec);
}
-bool os::uncommit_memory(char* addr, size_t bytes) {
+bool os::pd_uncommit_memory(char* addr, size_t bytes) {
if (bytes == 0) {
// Don't bother the OS with noops.
return true;
}
assert((size_t) addr % os::vm_page_size() == 0, "uncommit on page boundaries");
assert(bytes % os::vm_page_size() == 0, "uncommit in page-sized chunks");
- return VirtualFree(addr, bytes, MEM_DECOMMIT) != 0;
+ return (VirtualFree(addr, bytes, MEM_DECOMMIT) != 0);
}
-bool os::release_memory(char* addr, size_t bytes) {
+bool os::pd_release_memory(char* addr, size_t bytes) {
return VirtualFree(addr, 0, MEM_RELEASE) != 0;
}
-bool os::create_stack_guard_pages(char* addr, size_t size) {
+bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
return os::commit_memory(addr, size);
}
@@ -3141,8 +3157,8 @@ bool os::unguard_memory(char* addr, size_t bytes) {
return VirtualProtect(addr, bytes, PAGE_READWRITE, &old_status) != 0;
}
-void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { }
-void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) { }
+void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) { }
+void os::pd_free_memory(char *addr, size_t bytes, size_t alignment_hint) { }
void os::numa_make_global(char *addr, size_t bytes) { }
void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { }
bool os::numa_topology_changed() { return false; }
@@ -4276,14 +4292,14 @@ static int stdinAvailable(int fd, long *pbytes) {
numEvents = MAX_INPUT_EVENTS;
}
- lpBuffer = (INPUT_RECORD *)os::malloc(numEvents * sizeof(INPUT_RECORD));
+ lpBuffer = (INPUT_RECORD *)os::malloc(numEvents * sizeof(INPUT_RECORD), mtInternal);
if (lpBuffer == NULL) {
return FALSE;
}
error = ::PeekConsoleInput(han, lpBuffer, numEvents, &numEventsRead);
if (error == 0) {
- os::free(lpBuffer);
+ os::free(lpBuffer, mtInternal);
return FALSE;
}
@@ -4304,7 +4320,7 @@ static int stdinAvailable(int fd, long *pbytes) {
}
if(lpBuffer != NULL) {
- os::free(lpBuffer);
+ os::free(lpBuffer, mtInternal);
}
*pbytes = (long) actualLength;
@@ -4312,7 +4328,7 @@ static int stdinAvailable(int fd, long *pbytes) {
}
// Map a block of memory.
-char* os::map_memory(int fd, const char* file_name, size_t file_offset,
+char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec) {
HANDLE hFile;
@@ -4432,7 +4448,7 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset,
// Remap a block of memory.
-char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
+char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec) {
// This OS does not allow existing memory maps to be remapped so we
@@ -4445,15 +4461,15 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
// call above and the map_memory() call below where a thread in native
// code may be able to access an address that is no longer mapped.
- return os::map_memory(fd, file_name, file_offset, addr, bytes, read_only,
- allow_exec);
+ return os::map_memory(fd, file_name, file_offset, addr, bytes,
+ read_only, allow_exec);
}
// Unmap a block of memory.
// Returns true=success, otherwise false.
-bool os::unmap_memory(char* addr, size_t bytes) {
+bool os::pd_unmap_memory(char* addr, size_t bytes) {
BOOL result = UnmapViewOfFile(addr);
if (result == 0) {
if (PrintMiscellaneous && Verbose) {
@@ -4931,11 +4947,15 @@ typedef SIZE_T (WINAPI* GetLargePageMinimum_Fn)(void);
typedef LPVOID (WINAPI *VirtualAllocExNuma_Fn) (HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD);
typedef BOOL (WINAPI *GetNumaHighestNodeNumber_Fn) (PULONG);
typedef BOOL (WINAPI *GetNumaNodeProcessorMask_Fn) (UCHAR, PULONGLONG);
+typedef USHORT (WINAPI* RtlCaptureStackBackTrace_Fn)(ULONG, ULONG, PVOID*, PULONG);
GetLargePageMinimum_Fn os::Kernel32Dll::_GetLargePageMinimum = NULL;
VirtualAllocExNuma_Fn os::Kernel32Dll::_VirtualAllocExNuma = NULL;
GetNumaHighestNodeNumber_Fn os::Kernel32Dll::_GetNumaHighestNodeNumber = NULL;
GetNumaNodeProcessorMask_Fn os::Kernel32Dll::_GetNumaNodeProcessorMask = NULL;
+RtlCaptureStackBackTrace_Fn os::Kernel32Dll::_RtlCaptureStackBackTrace = NULL;
+
+
BOOL os::Kernel32Dll::initialized = FALSE;
SIZE_T os::Kernel32Dll::GetLargePageMinimum() {
assert(initialized && _GetLargePageMinimum != NULL,
@@ -4978,6 +4998,19 @@ BOOL os::Kernel32Dll::GetNumaNodeProcessorMask(UCHAR node, PULONGLONG proc_mask)
return _GetNumaNodeProcessorMask(node, proc_mask);
}
+USHORT os::Kernel32Dll::RtlCaptureStackBackTrace(ULONG FrameToSkip,
+ ULONG FrameToCapture, PVOID* BackTrace, PULONG BackTraceHash) {
+ if (!initialized) {
+ initialize();
+ }
+
+ if (_RtlCaptureStackBackTrace != NULL) {
+ return _RtlCaptureStackBackTrace(FrameToSkip, FrameToCapture,
+ BackTrace, BackTraceHash);
+ } else {
+ return 0;
+ }
+}
void os::Kernel32Dll::initializeCommon() {
if (!initialized) {
@@ -4987,6 +5020,7 @@ void os::Kernel32Dll::initializeCommon() {
_VirtualAllocExNuma = (VirtualAllocExNuma_Fn)::GetProcAddress(handle, "VirtualAllocExNuma");
_GetNumaHighestNodeNumber = (GetNumaHighestNodeNumber_Fn)::GetProcAddress(handle, "GetNumaHighestNodeNumber");
_GetNumaNodeProcessorMask = (GetNumaNodeProcessorMask_Fn)::GetProcAddress(handle, "GetNumaNodeProcessorMask");
+ _RtlCaptureStackBackTrace = (RtlCaptureStackBackTrace_Fn)::GetProcAddress(handle, "RtlCaptureStackBackTrace");
initialized = TRUE;
}
}
@@ -5101,7 +5135,6 @@ Module32First_Fn os::Kernel32Dll::_Module32First = NULL;
Module32Next_Fn os::Kernel32Dll::_Module32Next = NULL;
GetNativeSystemInfo_Fn os::Kernel32Dll::_GetNativeSystemInfo = NULL;
-
void os::Kernel32Dll::initialize() {
if (!initialized) {
HMODULE handle = ::GetModuleHandle("Kernel32.dll");
@@ -5179,8 +5212,6 @@ void os::Kernel32Dll::GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo) {
_GetNativeSystemInfo(lpSystemInfo);
}
-
-
// PSAPI API
diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp
index e0692e5f2f7..33ea7064ba6 100644
--- a/hotspot/src/os/windows/vm/os_windows.hpp
+++ b/hotspot/src/os/windows/vm/os_windows.hpp
@@ -98,7 +98,7 @@ class win32 {
static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e);
};
-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 ;
@@ -124,7 +124,7 @@ class PlatformEvent : public CHeapObj {
-class PlatformParker : public CHeapObj {
+class PlatformParker : public CHeapObj {
protected:
HANDLE _ParkEvent ;
@@ -182,6 +182,9 @@ public:
static BOOL GetNumaHighestNodeNumber(PULONG);
static BOOL GetNumaNodeProcessorMask(UCHAR, PULONGLONG);
+ // Stack walking
+ static USHORT RtlCaptureStackBackTrace(ULONG, ULONG, PVOID*, PULONG);
+
private:
// GetLargePageMinimum available on Windows Vista/Windows Server 2003
// and later
@@ -191,6 +194,7 @@ private:
static LPVOID (WINAPI *_VirtualAllocExNuma) (HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD);
static BOOL (WINAPI *_GetNumaHighestNodeNumber) (PULONG);
static BOOL (WINAPI *_GetNumaNodeProcessorMask) (UCHAR, PULONGLONG);
+ static USHORT (WINAPI *_RtlCaptureStackBackTrace)(ULONG, ULONG, PVOID*, PULONG);
static BOOL initialized;
static void initialize();
diff --git a/hotspot/src/os/windows/vm/perfMemory_windows.cpp b/hotspot/src/os/windows/vm/perfMemory_windows.cpp
index 4f3280d5906..2358171b78a 100644
--- a/hotspot/src/os/windows/vm/perfMemory_windows.cpp
+++ b/hotspot/src/os/windows/vm/perfMemory_windows.cpp
@@ -120,7 +120,7 @@ static void save_memory_to_file(char* addr, size_t size) {
}
}
- FREE_C_HEAP_ARRAY(char, destfile);
+ FREE_C_HEAP_ARRAY(char, destfile, mtInternal);
}
// Shared Memory Implementation Details
@@ -157,7 +157,7 @@ static char* get_user_tmp_dir(const char* user) {
const char* tmpdir = os::get_temp_directory();
const char* perfdir = PERFDATA_NAME;
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
- char* dirname = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
// construct the path name to user specific tmp directory
_snprintf(dirname, nbytes, "%s\\%s_%s", tmpdir, perfdir, user);
@@ -281,7 +281,7 @@ static char* get_user_name() {
}
}
- char* user_name = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
+ char* user_name = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
strcpy(user_name, user);
return user_name;
@@ -315,7 +315,7 @@ static char* get_user_name_slow(int vmid) {
// to determine the user name for the process id.
//
struct dirent* dentry;
- char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname));
+ char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal);
errno = 0;
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
@@ -325,7 +325,7 @@ static char* get_user_name_slow(int vmid) {
}
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
- strlen(tmpdirname) + strlen(dentry->d_name) + 2);
+ strlen(tmpdirname) + strlen(dentry->d_name) + 2, mtInternal);
strcpy(usrdir_name, tmpdirname);
strcat(usrdir_name, "\\");
strcat(usrdir_name, dentry->d_name);
@@ -333,7 +333,7 @@ static char* get_user_name_slow(int vmid) {
DIR* subdirp = os::opendir(usrdir_name);
if (subdirp == NULL) {
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
continue;
}
@@ -344,13 +344,13 @@ static char* get_user_name_slow(int vmid) {
// symlink can be exploited.
//
if (!is_directory_secure(usrdir_name)) {
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
os::closedir(subdirp);
continue;
}
struct dirent* udentry;
- char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name));
+ char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal);
errno = 0;
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
@@ -358,20 +358,20 @@ static char* get_user_name_slow(int vmid) {
struct stat statbuf;
char* filename = NEW_C_HEAP_ARRAY(char,
- strlen(usrdir_name) + strlen(udentry->d_name) + 2);
+ strlen(usrdir_name) + strlen(udentry->d_name) + 2, mtInternal);
strcpy(filename, usrdir_name);
strcat(filename, "\\");
strcat(filename, udentry->d_name);
if (::stat(filename, &statbuf) == OS_ERR) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
continue;
}
// skip over files that are not regular files.
if ((statbuf.st_mode & S_IFMT) != S_IFREG) {
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
continue;
}
@@ -393,22 +393,22 @@ static char* get_user_name_slow(int vmid) {
if (statbuf.st_ctime > latest_ctime) {
char* user = strchr(dentry->d_name, '_') + 1;
- if (latest_user != NULL) FREE_C_HEAP_ARRAY(char, latest_user);
- latest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
+ if (latest_user != NULL) FREE_C_HEAP_ARRAY(char, latest_user, mtInternal);
+ latest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
strcpy(latest_user, user);
latest_ctime = statbuf.st_ctime;
}
- FREE_C_HEAP_ARRAY(char, filename);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
}
}
os::closedir(subdirp);
- FREE_C_HEAP_ARRAY(char, udbuf);
- FREE_C_HEAP_ARRAY(char, usrdir_name);
+ FREE_C_HEAP_ARRAY(char, udbuf, mtInternal);
+ FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
}
os::closedir(tmpdirp);
- FREE_C_HEAP_ARRAY(char, tdbuf);
+ FREE_C_HEAP_ARRAY(char, tdbuf, mtInternal);
return(latest_user);
}
@@ -453,7 +453,7 @@ static char *get_sharedmem_objectname(const char* user, int vmid) {
// about a name containing a '-' characters.
//
nbytes += UINT_CHARS;
- char* name = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* name = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
_snprintf(name, nbytes, "%s_%s_%u", PERFDATA_NAME, user, vmid);
return name;
@@ -469,7 +469,7 @@ static char* get_sharedmem_filename(const char* dirname, int vmid) {
// add 2 for the file separator and a null terminator.
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
- char* name = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* name = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
_snprintf(name, nbytes, "%s\\%d", dirname, vmid);
return name;
@@ -485,7 +485,7 @@ static char* get_sharedmem_filename(const char* dirname, int vmid) {
static void remove_file(const char* dirname, const char* filename) {
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
- char* path = NEW_C_HEAP_ARRAY(char, nbytes);
+ char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
strcpy(path, dirname);
strcat(path, "\\");
@@ -500,7 +500,7 @@ static void remove_file(const char* dirname, const char* filename) {
}
}
- FREE_C_HEAP_ARRAY(char, path);
+ FREE_C_HEAP_ARRAY(char, path, mtInternal);
}
// returns true if the process represented by pid is alive, otherwise
@@ -638,7 +638,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
// opendir/readdir.
//
struct dirent* entry;
- char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname));
+ char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
errno = 0;
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
@@ -681,7 +681,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
errno = 0;
}
os::closedir(dirp);
- FREE_C_HEAP_ARRAY(char, dbuf);
+ FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
}
// create a file mapping object with the requested name, and size
@@ -747,11 +747,11 @@ static void free_security_desc(PSECURITY_DESCRIPTOR pSD) {
// be an ACL we enlisted. free the resources.
//
if (success && exists && pACL != NULL && !isdefault) {
- FREE_C_HEAP_ARRAY(char, pACL);
+ FREE_C_HEAP_ARRAY(char, pACL, mtInternal);
}
// free the security descriptor
- FREE_C_HEAP_ARRAY(char, pSD);
+ FREE_C_HEAP_ARRAY(char, pSD, mtInternal);
}
}
@@ -766,7 +766,7 @@ static void free_security_attr(LPSECURITY_ATTRIBUTES lpSA) {
lpSA->lpSecurityDescriptor = NULL;
// free the security attributes structure
- FREE_C_HEAP_ARRAY(char, lpSA);
+ FREE_C_HEAP_ARRAY(char, lpSA, mtInternal);
}
}
@@ -805,7 +805,7 @@ static PSID get_user_sid(HANDLE hProcess) {
}
}
- token_buf = (PTOKEN_USER) NEW_C_HEAP_ARRAY(char, rsize);
+ token_buf = (PTOKEN_USER) NEW_C_HEAP_ARRAY(char, rsize, mtInternal);
// get the user token information
if (!GetTokenInformation(hAccessToken, TokenUser, token_buf, rsize, &rsize)) {
@@ -813,28 +813,28 @@ static PSID get_user_sid(HANDLE hProcess) {
warning("GetTokenInformation failure: lasterror = %d,"
" rsize = %d\n", GetLastError(), rsize);
}
- FREE_C_HEAP_ARRAY(char, token_buf);
+ FREE_C_HEAP_ARRAY(char, token_buf, mtInternal);
CloseHandle(hAccessToken);
return NULL;
}
DWORD nbytes = GetLengthSid(token_buf->User.Sid);
- PSID pSID = NEW_C_HEAP_ARRAY(char, nbytes);
+ PSID pSID = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
if (!CopySid(nbytes, pSID, token_buf->User.Sid)) {
if (PrintMiscellaneous && Verbose) {
warning("GetTokenInformation failure: lasterror = %d,"
" rsize = %d\n", GetLastError(), rsize);
}
- FREE_C_HEAP_ARRAY(char, token_buf);
- FREE_C_HEAP_ARRAY(char, pSID);
+ FREE_C_HEAP_ARRAY(char, token_buf, mtInternal);
+ FREE_C_HEAP_ARRAY(char, pSID, mtInternal);
CloseHandle(hAccessToken);
return NULL;
}
// close the access token.
CloseHandle(hAccessToken);
- FREE_C_HEAP_ARRAY(char, token_buf);
+ FREE_C_HEAP_ARRAY(char, token_buf, mtInternal);
return pSID;
}
@@ -912,13 +912,13 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
}
// create the new ACL
- newACL = (PACL) NEW_C_HEAP_ARRAY(char, newACLsize);
+ newACL = (PACL) NEW_C_HEAP_ARRAY(char, newACLsize, mtInternal);
if (!InitializeAcl(newACL, newACLsize, ACL_REVISION)) {
if (PrintMiscellaneous && Verbose) {
warning("InitializeAcl failure: lasterror = %d \n", GetLastError());
}
- FREE_C_HEAP_ARRAY(char, newACL);
+ FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
return false;
}
@@ -931,7 +931,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
if (PrintMiscellaneous && Verbose) {
warning("InitializeAcl failure: lasterror = %d \n", GetLastError());
}
- FREE_C_HEAP_ARRAY(char, newACL);
+ FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
return false;
}
if (((ACCESS_ALLOWED_ACE *)ace)->Header.AceFlags && INHERITED_ACE) {
@@ -958,7 +958,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
if (PrintMiscellaneous && Verbose) {
warning("AddAce failure: lasterror = %d \n", GetLastError());
}
- FREE_C_HEAP_ARRAY(char, newACL);
+ FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
return false;
}
}
@@ -974,7 +974,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
warning("AddAccessAllowedAce failure: lasterror = %d \n",
GetLastError());
}
- FREE_C_HEAP_ARRAY(char, newACL);
+ FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
return false;
}
}
@@ -989,7 +989,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
if (PrintMiscellaneous && Verbose) {
warning("InitializeAcl failure: lasterror = %d \n", GetLastError());
}
- FREE_C_HEAP_ARRAY(char, newACL);
+ FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
return false;
}
if (!AddAce(newACL, ACL_REVISION, MAXDWORD, ace,
@@ -997,7 +997,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
if (PrintMiscellaneous && Verbose) {
warning("AddAce failure: lasterror = %d \n", GetLastError());
}
- FREE_C_HEAP_ARRAY(char, newACL);
+ FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
return false;
}
ace_index++;
@@ -1010,7 +1010,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
warning("SetSecurityDescriptorDacl failure:"
" lasterror = %d \n", GetLastError());
}
- FREE_C_HEAP_ARRAY(char, newACL);
+ FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
return false;
}
@@ -1030,7 +1030,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
warning("SetSecurityDescriptorControl failure:"
" lasterror = %d \n", GetLastError());
}
- FREE_C_HEAP_ARRAY(char, newACL);
+ FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
return false;
}
}
@@ -1054,7 +1054,7 @@ static LPSECURITY_ATTRIBUTES make_security_attr(ace_data_t aces[], int count) {
// allocate space for a security descriptor
PSECURITY_DESCRIPTOR pSD = (PSECURITY_DESCRIPTOR)
- NEW_C_HEAP_ARRAY(char, SECURITY_DESCRIPTOR_MIN_LENGTH);
+ NEW_C_HEAP_ARRAY(char, SECURITY_DESCRIPTOR_MIN_LENGTH, mtInternal);
// initialize the security descriptor
if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)) {
@@ -1076,7 +1076,7 @@ static LPSECURITY_ATTRIBUTES make_security_attr(ace_data_t aces[], int count) {
// return it to the caller.
//
LPSECURITY_ATTRIBUTES lpSA = (LPSECURITY_ATTRIBUTES)
- NEW_C_HEAP_ARRAY(char, sizeof(SECURITY_ATTRIBUTES));
+ NEW_C_HEAP_ARRAY(char, sizeof(SECURITY_ATTRIBUTES), mtInternal);
lpSA->nLength = sizeof(SECURITY_ATTRIBUTES);
lpSA->lpSecurityDescriptor = pSD;
lpSA->bInheritHandle = FALSE;
@@ -1147,7 +1147,7 @@ static LPSECURITY_ATTRIBUTES make_user_everybody_admin_security_attr(
// create a security attributes structure with access control
// entries as initialized above.
LPSECURITY_ATTRIBUTES lpSA = make_security_attr(aces, 3);
- FREE_C_HEAP_ARRAY(char, aces[0].pSid);
+ FREE_C_HEAP_ARRAY(char, aces[0].pSid, mtInternal);
FreeSid(everybodySid);
FreeSid(administratorsSid);
return(lpSA);
@@ -1462,15 +1462,15 @@ static char* mapping_create_shared(size_t size) {
assert(((size != 0) && (size % os::vm_page_size() == 0)),
"unexpected PerfMemry region size");
- FREE_C_HEAP_ARRAY(char, user);
+ FREE_C_HEAP_ARRAY(char, user, mtInternal);
// create the shared memory resources
sharedmem_fileMapHandle =
create_sharedmem_resources(dirname, filename, objectname, size);
- FREE_C_HEAP_ARRAY(char, filename);
- FREE_C_HEAP_ARRAY(char, objectname);
- FREE_C_HEAP_ARRAY(char, dirname);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
+ FREE_C_HEAP_ARRAY(char, objectname, mtInternal);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
if (sharedmem_fileMapHandle == NULL) {
return NULL;
@@ -1621,7 +1621,7 @@ static void open_file_mapping(const char* user, int vmid,
// store file, we also don't following them when attaching
//
if (!is_directory_secure(dirname)) {
- FREE_C_HEAP_ARRAY(char, dirname);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
"Process not found");
}
@@ -1640,10 +1640,10 @@ static void open_file_mapping(const char* user, int vmid,
strcpy(robjectname, objectname);
// free the c heap resources that are no longer needed
- if (luser != user) FREE_C_HEAP_ARRAY(char, luser);
- FREE_C_HEAP_ARRAY(char, dirname);
- FREE_C_HEAP_ARRAY(char, filename);
- FREE_C_HEAP_ARRAY(char, objectname);
+ if (luser != user) FREE_C_HEAP_ARRAY(char, luser, mtInternal);
+ FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
+ FREE_C_HEAP_ARRAY(char, filename, mtInternal);
+ FREE_C_HEAP_ARRAY(char, objectname, mtInternal);
if (*sizep == 0) {
size = sharedmem_filesize(rfilename, CHECK);
diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp
index f52b942df2c..8235786b40a 100644
--- a/hotspot/src/share/vm/asm/codeBuffer.cpp
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp
@@ -261,7 +261,7 @@ address CodeBuffer::decode_begin() {
GrowableArray* CodeBuffer::create_patch_overflow() {
if (_overflow_arena == NULL) {
- _overflow_arena = new Arena();
+ _overflow_arena = new (mtCode) Arena();
}
return new (_overflow_arena) GrowableArray(_overflow_arena, 8, 0, 0);
}
@@ -910,7 +910,7 @@ void CodeBuffer::block_comment(intptr_t offset, const char * comment) {
_comments.add_comment(offset, comment);
}
-class CodeComment: public CHeapObj {
+class CodeComment: public CHeapObj {
private:
friend class CodeComments;
intptr_t _offset;
@@ -919,13 +919,13 @@ class CodeComment: public CHeapObj {
~CodeComment() {
assert(_next == NULL, "wrong interface for freeing list");
- os::free((void*)_comment);
+ os::free((void*)_comment, mtCode);
}
public:
CodeComment(intptr_t offset, const char * comment) {
_offset = offset;
- _comment = os::strdup(comment);
+ _comment = os::strdup(comment, mtCode);
_next = NULL;
}
diff --git a/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp b/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp
index 4964ebd683e..66a7e225ebd 100644
--- a/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp
+++ b/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp
@@ -33,7 +33,7 @@
#ifndef PRODUCT
-class CFGPrinterOutput : public CHeapObj {
+class CFGPrinterOutput : public CHeapObj {
private:
outputStream* _output;
@@ -106,7 +106,7 @@ void CFGPrinter::print_intervals(IntervalList* intervals, const char* name) {
CFGPrinterOutput::CFGPrinterOutput()
- : _output(new(ResourceObj::C_HEAP) fileStream("output.cfg"))
+ : _output(new(ResourceObj::C_HEAP, mtCompiler) fileStream("output.cfg"))
{
}
diff --git a/hotspot/src/share/vm/c1/c1_Compiler.cpp b/hotspot/src/share/vm/c1/c1_Compiler.cpp
index 41b5eb572e6..7e55ce30fd6 100644
--- a/hotspot/src/share/vm/c1/c1_Compiler.cpp
+++ b/hotspot/src/share/vm/c1/c1_Compiler.cpp
@@ -55,7 +55,7 @@ Compiler::~Compiler() {
void Compiler::initialize_all() {
BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
- Arena* arena = new Arena();
+ Arena* arena = new (mtCompiler) Arena();
Runtime1::initialize(buffer_blob);
FrameMap::initialize();
// initialize data structures
diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp
index 56f94636586..bd4061ec787 100644
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp
@@ -2467,12 +2467,12 @@ void LinearScan::compute_oop_map(IntervalWalker* iw, const LIR_OpVisitState &vis
// Allocate them with new so they are never destroyed (otherwise, a
// forced exit could destroy these objects while they are still in
// use).
-ConstantOopWriteValue* LinearScan::_oop_null_scope_value = new (ResourceObj::C_HEAP) ConstantOopWriteValue(NULL);
-ConstantIntValue* LinearScan::_int_m1_scope_value = new (ResourceObj::C_HEAP) ConstantIntValue(-1);
-ConstantIntValue* LinearScan::_int_0_scope_value = new (ResourceObj::C_HEAP) ConstantIntValue(0);
-ConstantIntValue* LinearScan::_int_1_scope_value = new (ResourceObj::C_HEAP) ConstantIntValue(1);
-ConstantIntValue* LinearScan::_int_2_scope_value = new (ResourceObj::C_HEAP) ConstantIntValue(2);
-LocationValue* _illegal_value = new (ResourceObj::C_HEAP) LocationValue(Location());
+ConstantOopWriteValue* LinearScan::_oop_null_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantOopWriteValue(NULL);
+ConstantIntValue* LinearScan::_int_m1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(-1);
+ConstantIntValue* LinearScan::_int_0_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(0);
+ConstantIntValue* LinearScan::_int_1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(1);
+ConstantIntValue* LinearScan::_int_2_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(2);
+LocationValue* _illegal_value = new (ResourceObj::C_HEAP, mtCompiler) LocationValue(Location());
void LinearScan::init_compute_debug_info() {
// cache for frequently used scope values
diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.cpp b/hotspot/src/share/vm/ci/ciObjectFactory.cpp
index 9aa6b261118..a68fb1259ce 100644
--- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp
+++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp
@@ -111,7 +111,7 @@ void ciObjectFactory::initialize() {
// This Arena is long lived and exists in the resource mark of the
// compiler thread that initializes the initial ciObjectFactory which
// creates the shared ciObjects that all later ciObjectFactories use.
- Arena* arena = new Arena();
+ Arena* arena = new (mtCompiler) Arena();
ciEnv initial(arena);
ciEnv* env = ciEnv::current();
env->_factory->init_shared_objects();
diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
index b2330e61e37..1be1c7bf19c 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
@@ -1368,7 +1368,7 @@ class Classfile_LVT_Element VALUE_OBJ_CLASS_SPEC {
};
-class LVT_Hash: public CHeapObj {
+class LVT_Hash: public CHeapObj {
public:
LocalVariableTableElement *_elem; // element
LVT_Hash* _next; // Next entry in hash table
diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp
index df42dc75d42..a2e61a4ad3b 100644
--- a/hotspot/src/share/vm/classfile/classLoader.cpp
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp
@@ -153,7 +153,7 @@ MetaIndex::MetaIndex(char** meta_package_names, int num_meta_package_names) {
_meta_package_names = NULL;
_num_meta_package_names = 0;
} else {
- _meta_package_names = NEW_C_HEAP_ARRAY(char*, num_meta_package_names);
+ _meta_package_names = NEW_C_HEAP_ARRAY(char*, num_meta_package_names, mtClass);
_num_meta_package_names = num_meta_package_names;
memcpy(_meta_package_names, meta_package_names, num_meta_package_names * sizeof(char*));
}
@@ -161,7 +161,7 @@ MetaIndex::MetaIndex(char** meta_package_names, int num_meta_package_names) {
MetaIndex::~MetaIndex() {
- FREE_C_HEAP_ARRAY(char*, _meta_package_names);
+ FREE_C_HEAP_ARRAY(char*, _meta_package_names, mtClass);
}
@@ -192,7 +192,7 @@ bool ClassPathEntry::is_lazy() {
}
ClassPathDirEntry::ClassPathDirEntry(char* dir) : ClassPathEntry() {
- _dir = NEW_C_HEAP_ARRAY(char, strlen(dir)+1);
+ _dir = NEW_C_HEAP_ARRAY(char, strlen(dir)+1, mtClass);
strcpy(_dir, dir);
}
@@ -229,7 +229,7 @@ ClassFileStream* ClassPathDirEntry::open_stream(const char* name) {
ClassPathZipEntry::ClassPathZipEntry(jzfile* zip, const char* zip_name) : ClassPathEntry() {
_zip = zip;
- _zip_name = NEW_C_HEAP_ARRAY(char, strlen(zip_name)+1);
+ _zip_name = NEW_C_HEAP_ARRAY(char, strlen(zip_name)+1, mtClass);
strcpy(_zip_name, zip_name);
}
@@ -237,7 +237,7 @@ ClassPathZipEntry::~ClassPathZipEntry() {
if (ZipClose != NULL) {
(*ZipClose)(_zip);
}
- FREE_C_HEAP_ARRAY(char, _zip_name);
+ FREE_C_HEAP_ARRAY(char, _zip_name, mtClass);
}
ClassFileStream* ClassPathZipEntry::open_stream(const char* name) {
@@ -454,11 +454,11 @@ void ClassLoader::setup_bootstrap_search_path() {
while (sys_class_path[end] && sys_class_path[end] != os::path_separator()[0]) {
end++;
}
- char* path = NEW_C_HEAP_ARRAY(char, end-start+1);
+ char* path = NEW_C_HEAP_ARRAY(char, end-start+1, mtClass);
strncpy(path, &sys_class_path[start], end-start);
path[end-start] = '\0';
update_class_path_entry_list(path, false);
- FREE_C_HEAP_ARRAY(char, path);
+ FREE_C_HEAP_ARRAY(char, path, mtClass);
while (sys_class_path[end] == os::path_separator()[0]) {
end++;
}
@@ -652,13 +652,13 @@ void ClassLoader::load_zip_library() {
// in the classpath must be the same files, in the same order, even
// though the exact name is not the same.
-class PackageInfo: public BasicHashtableEntry {
+class PackageInfo: public BasicHashtableEntry {
public:
const char* _pkgname; // Package name
int _classpath_index; // Index of directory or JAR file loaded from
PackageInfo* next() {
- return (PackageInfo*)BasicHashtableEntry::next();
+ return (PackageInfo*)BasicHashtableEntry::next();
}
const char* pkgname() { return _pkgname; }
@@ -674,7 +674,7 @@ public:
};
-class PackageHashtable : public BasicHashtable {
+class PackageHashtable : public BasicHashtable {
private:
inline unsigned int compute_hash(const char *s, int n) {
unsigned int val = 0;
@@ -685,7 +685,7 @@ private:
}
PackageInfo* bucket(int index) {
- return (PackageInfo*)BasicHashtable::bucket(index);
+ return (PackageInfo*)BasicHashtable::bucket(index);
}
PackageInfo* get_entry(int index, unsigned int hash,
@@ -702,10 +702,10 @@ private:
public:
PackageHashtable(int table_size)
- : BasicHashtable(table_size, sizeof(PackageInfo)) {}
+ : BasicHashtable(table_size, sizeof(PackageInfo)) {}
- PackageHashtable(int table_size, HashtableBucket* t, int number_of_entries)
- : BasicHashtable(table_size, sizeof(PackageInfo), t, number_of_entries) {}
+ PackageHashtable(int table_size, HashtableBucket* t, int number_of_entries)
+ : BasicHashtable(table_size, sizeof(PackageInfo), t, number_of_entries) {}
PackageInfo* get_entry(const char* pkgname, int n) {
unsigned int hash = compute_hash(pkgname, n);
@@ -715,14 +715,14 @@ public:
PackageInfo* new_entry(char* pkgname, int n) {
unsigned int hash = compute_hash(pkgname, n);
PackageInfo* pp;
- pp = (PackageInfo*)BasicHashtable::new_entry(hash);
+ pp = (PackageInfo*)BasicHashtable::new_entry(hash);
pp->set_pkgname(pkgname);
return pp;
}
void add_entry(PackageInfo* pp) {
int index = hash_to_index(pp->hash());
- BasicHashtable::add_entry(index, pp);
+ BasicHashtable::add_entry(index, pp);
}
void copy_pkgnames(const char** packages) {
@@ -742,7 +742,7 @@ public:
void PackageHashtable::copy_table(char** top, char* end,
PackageHashtable* table) {
// Copy (relocate) the table to the shared space.
- BasicHashtable::copy_table(top, end);
+ BasicHashtable::copy_table(top, end);
// Calculate the space needed for the package name strings.
int i;
@@ -815,7 +815,7 @@ bool ClassLoader::add_package(const char *pkgname, int classpath_index, TRAPS) {
// Package prefix found
int n = cp - pkgname + 1;
- char* new_pkgname = NEW_C_HEAP_ARRAY(char, n + 1);
+ char* new_pkgname = NEW_C_HEAP_ARRAY(char, n + 1, mtClass);
if (new_pkgname == NULL) {
return false;
}
@@ -929,10 +929,10 @@ instanceKlassHandle ClassLoader::load_classfile(Symbol* h_name, TRAPS) {
}
-void ClassLoader::create_package_info_table(HashtableBucket *t, int length,
+void ClassLoader::create_package_info_table(HashtableBucket *t, int length,
int number_of_entries) {
assert(_package_hash_table == NULL, "One package info table allowed.");
- assert(length == package_hash_table_size * sizeof(HashtableBucket),
+ assert(length == package_hash_table_size * sizeof(HashtableBucket),
"bad shared package info size.");
_package_hash_table = new PackageHashtable(package_hash_table_size, t,
number_of_entries);
diff --git a/hotspot/src/share/vm/classfile/classLoader.hpp b/hotspot/src/share/vm/classfile/classLoader.hpp
index 6f816837ae7..ee58550b61e 100644
--- a/hotspot/src/share/vm/classfile/classLoader.hpp
+++ b/hotspot/src/share/vm/classfile/classLoader.hpp
@@ -33,7 +33,7 @@
// Meta-index (optional, to be able to skip opening boot classpath jar files)
-class MetaIndex: public CHeapObj {
+class MetaIndex: public CHeapObj {
private:
char** _meta_package_names;
int _num_meta_package_names;
@@ -46,7 +46,7 @@ class MetaIndex: public CHeapObj {
// Class path entry (directory or zip file)
-class ClassPathEntry: public CHeapObj {
+class ClassPathEntry: public CHeapObj {
private:
ClassPathEntry* _next;
public:
@@ -141,7 +141,7 @@ class LazyClassPathEntry: public ClassPathEntry {
class PackageHashtable;
class PackageInfo;
-class HashtableBucket;
+template class HashtableBucket;
class ClassLoader: AllStatic {
public:
@@ -299,7 +299,7 @@ class ClassLoader: AllStatic {
// Initialization
static void initialize();
static void create_package_info_table();
- static void create_package_info_table(HashtableBucket *t, int length,
+ static void create_package_info_table(HashtableBucket *t, int length,
int number_of_entries);
static int compute_Object_vtable();
diff --git a/hotspot/src/share/vm/classfile/dictionary.cpp b/hotspot/src/share/vm/classfile/dictionary.cpp
index 4458f46d7a9..78e76cc1f67 100644
--- a/hotspot/src/share/vm/classfile/dictionary.cpp
+++ b/hotspot/src/share/vm/classfile/dictionary.cpp
@@ -36,16 +36,16 @@ int Dictionary::_current_class_index = 0;
Dictionary::Dictionary(int table_size)
- : TwoOopHashtable(table_size, sizeof(DictionaryEntry)) {
+ : TwoOopHashtable(table_size, sizeof(DictionaryEntry)) {
_current_class_index = 0;
_current_class_entry = NULL;
};
-Dictionary::Dictionary(int table_size, HashtableBucket* t,
+Dictionary::Dictionary(int table_size, HashtableBucket* t,
int number_of_entries)
- : TwoOopHashtable(table_size, sizeof(DictionaryEntry), t, number_of_entries) {
+ : TwoOopHashtable(table_size, sizeof(DictionaryEntry), t, number_of_entries) {
_current_class_index = 0;
_current_class_entry = NULL;
};
@@ -54,7 +54,7 @@ Dictionary::Dictionary(int table_size, HashtableBucket* t,
DictionaryEntry* Dictionary::new_entry(unsigned int hash, klassOop klass,
oop loader) {
DictionaryEntry* entry;
- entry = (DictionaryEntry*)Hashtable::new_entry(hash, klass);
+ entry = (DictionaryEntry*)Hashtable::new_entry(hash, klass);
entry->set_loader(loader);
entry->set_pd_set(NULL);
return entry;
@@ -62,7 +62,7 @@ DictionaryEntry* Dictionary::new_entry(unsigned int hash, klassOop klass,
DictionaryEntry* Dictionary::new_entry() {
- DictionaryEntry* entry = (DictionaryEntry*)Hashtable::new_entry(0L, NULL);
+ DictionaryEntry* entry = (DictionaryEntry*)Hashtable::new_entry(0L, NULL);
entry->set_loader(NULL);
entry->set_pd_set(NULL);
return entry;
@@ -76,7 +76,7 @@ void Dictionary::free_entry(DictionaryEntry* entry) {
entry->set_pd_set(to_delete->next());
delete to_delete;
}
- Hashtable::free_entry(entry);
+ Hashtable::free_entry(entry);
}
@@ -554,12 +554,12 @@ void Dictionary::reorder_dictionary() {
}
SymbolPropertyTable::SymbolPropertyTable(int table_size)
- : Hashtable(table_size, sizeof(SymbolPropertyEntry))
+ : Hashtable(table_size, sizeof(SymbolPropertyEntry))
{
}
-SymbolPropertyTable::SymbolPropertyTable(int table_size, HashtableBucket* t,
+SymbolPropertyTable::SymbolPropertyTable(int table_size, HashtableBucket* t,
int number_of_entries)
- : Hashtable(table_size, sizeof(SymbolPropertyEntry), t, number_of_entries)
+ : Hashtable(table_size, sizeof(SymbolPropertyEntry), t, number_of_entries)
{
}
@@ -584,7 +584,7 @@ SymbolPropertyEntry* SymbolPropertyTable::add_entry(int index, unsigned int hash
assert(find_entry(index, hash, sym, sym_mode) == NULL, "no double entry");
SymbolPropertyEntry* p = new_entry(hash, sym, sym_mode);
- Hashtable::add_entry(index, p);
+ Hashtable::add_entry(index, p);
return p;
}
diff --git a/hotspot/src/share/vm/classfile/dictionary.hpp b/hotspot/src/share/vm/classfile/dictionary.hpp
index 98e01695001..bd33760b721 100644
--- a/hotspot/src/share/vm/classfile/dictionary.hpp
+++ b/hotspot/src/share/vm/classfile/dictionary.hpp
@@ -36,7 +36,7 @@ class DictionaryEntry;
// The data structure for the system dictionary (and the shared system
// dictionary).
-class Dictionary : public TwoOopHashtable {
+class Dictionary : public TwoOopHashtable {
friend class VMStructs;
private:
// current iteration index.
@@ -48,22 +48,22 @@ private:
Symbol* name, Handle loader);
DictionaryEntry* bucket(int i) {
- return (DictionaryEntry*)Hashtable::bucket(i);
+ return (DictionaryEntry*)Hashtable::bucket(i);
}
// The following method is not MT-safe and must be done under lock.
DictionaryEntry** bucket_addr(int i) {
- return (DictionaryEntry**)Hashtable::bucket_addr(i);
+ return (DictionaryEntry**)Hashtable::bucket_addr(i);
}
void add_entry(int index, DictionaryEntry* new_entry) {
- Hashtable::add_entry(index, (HashtableEntry*)new_entry);
+ Hashtable::add_entry(index, (HashtableEntry*)new_entry);
}
public:
Dictionary(int table_size);
- Dictionary(int table_size, HashtableBucket* t, int number_of_entries);
+ Dictionary(int table_size, HashtableBucket* t, int number_of_entries);
DictionaryEntry* new_entry(unsigned int hash, klassOop klass, oop loader);
@@ -129,7 +129,7 @@ public:
// The following classes can be in dictionary.cpp, but we need these
// to be in header file so that SA's vmStructs can access.
-class ProtectionDomainEntry :public CHeapObj {
+class ProtectionDomainEntry :public CHeapObj {
friend class VMStructs;
public:
ProtectionDomainEntry* _next;
@@ -147,7 +147,7 @@ class ProtectionDomainEntry :public CHeapObj {
// An entry in the system dictionary, this describes a class as
// { klassOop, loader, protection_domain }.
-class DictionaryEntry : public HashtableEntry {
+class DictionaryEntry : public HashtableEntry {
friend class VMStructs;
private:
// Contains the set of approved protection domains that can access
@@ -166,11 +166,11 @@ class DictionaryEntry : public HashtableEntry {
klassOop* klass_addr() { return (klassOop*)literal_addr(); }
DictionaryEntry* next() const {
- return (DictionaryEntry*)HashtableEntry::next();
+ return (DictionaryEntry*)HashtableEntry::next();
}
DictionaryEntry** next_addr() {
- return (DictionaryEntry**)HashtableEntry::next_addr();
+ return (DictionaryEntry**)HashtableEntry::next_addr();
}
oop loader() const { return _loader; }
@@ -228,7 +228,7 @@ class DictionaryEntry : public HashtableEntry {
// Entry in a SymbolPropertyTable, mapping a single Symbol*
// to a managed and an unmanaged pointer.
-class SymbolPropertyEntry : public HashtableEntry {
+class SymbolPropertyEntry : public HashtableEntry {
friend class VMStructs;
private:
intptr_t _symbol_mode; // secondary key
@@ -248,11 +248,11 @@ class SymbolPropertyEntry : public HashtableEntry {
void set_property_data(address p) { _property_data = p; }
SymbolPropertyEntry* next() const {
- return (SymbolPropertyEntry*)HashtableEntry::next();
+ return (SymbolPropertyEntry*)HashtableEntry::next();
}
SymbolPropertyEntry** next_addr() {
- return (SymbolPropertyEntry**)HashtableEntry::next_addr();
+ return (SymbolPropertyEntry**)HashtableEntry::next_addr();
}
oop* property_oop_addr() { return &_property_oop; }
@@ -278,16 +278,16 @@ class SymbolPropertyEntry : public HashtableEntry {
// A system-internal mapping of symbols to pointers, both managed
// and unmanaged. Used to record the auto-generation of each method
// MethodHandle.invoke(S)T, for all signatures (S)T.
-class SymbolPropertyTable : public Hashtable {
+class SymbolPropertyTable : public Hashtable {
friend class VMStructs;
private:
SymbolPropertyEntry* bucket(int i) {
- return (SymbolPropertyEntry*) Hashtable::bucket(i);
+ return (SymbolPropertyEntry*) Hashtable::bucket(i);
}
// The following method is not MT-safe and must be done under lock.
SymbolPropertyEntry** bucket_addr(int i) {
- return (SymbolPropertyEntry**) Hashtable::bucket_addr(i);
+ return (SymbolPropertyEntry**) Hashtable::bucket_addr(i);
}
void add_entry(int index, SymbolPropertyEntry* new_entry) {
@@ -298,7 +298,7 @@ private:
}
SymbolPropertyEntry* new_entry(unsigned int hash, Symbol* symbol, intptr_t symbol_mode) {
- SymbolPropertyEntry* entry = (SymbolPropertyEntry*) Hashtable::new_entry(hash, symbol);
+ SymbolPropertyEntry* entry = (SymbolPropertyEntry*) Hashtable::new_entry(hash, symbol);
// Hashtable with Symbol* literal must increment and decrement refcount.
symbol->increment_refcount();
entry->set_symbol_mode(symbol_mode);
@@ -309,17 +309,17 @@ private:
public:
SymbolPropertyTable(int table_size);
- SymbolPropertyTable(int table_size, HashtableBucket* t, int number_of_entries);
+ SymbolPropertyTable(int table_size, HashtableBucket* t, int number_of_entries);
void free_entry(SymbolPropertyEntry* entry) {
// decrement Symbol refcount here because hashtable doesn't.
entry->literal()->decrement_refcount();
- Hashtable::free_entry(entry);
+ Hashtable::free_entry(entry);
}
unsigned int compute_hash(Symbol* sym, intptr_t symbol_mode) {
// Use the regular identity_hash.
- return Hashtable::compute_hash(sym) ^ symbol_mode;
+ return Hashtable::compute_hash(sym) ^ symbol_mode;
}
int index_for(Symbol* name, intptr_t symbol_mode) {
diff --git a/hotspot/src/share/vm/classfile/javaAssertions.cpp b/hotspot/src/share/vm/classfile/javaAssertions.cpp
index 7884881dedc..3e6a8ce6041 100644
--- a/hotspot/src/share/vm/classfile/javaAssertions.cpp
+++ b/hotspot/src/share/vm/classfile/javaAssertions.cpp
@@ -58,7 +58,7 @@ void JavaAssertions::addOption(const char* name, bool enable) {
// it is never freed, so will be leaked (along with other option strings -
// e.g., bootclasspath) if a process creates/destroys multiple VMs.
int len = (int)strlen(name);
- char *name_copy = NEW_C_HEAP_ARRAY(char, len + 1);
+ char *name_copy = NEW_C_HEAP_ARRAY(char, len + 1, mtClass);
strcpy(name_copy, name);
// Figure out which list the new item should go on. Names that end in "..."
diff --git a/hotspot/src/share/vm/classfile/javaAssertions.hpp b/hotspot/src/share/vm/classfile/javaAssertions.hpp
index b0fb21a2d07..d06d9010f00 100644
--- a/hotspot/src/share/vm/classfile/javaAssertions.hpp
+++ b/hotspot/src/share/vm/classfile/javaAssertions.hpp
@@ -68,7 +68,7 @@ private:
static OptionList* _packages; // Options for package trees.
};
-class JavaAssertions::OptionList: public CHeapObj {
+class JavaAssertions::OptionList: public CHeapObj {
public:
inline OptionList(const char* name, bool enable, OptionList* next);
diff --git a/hotspot/src/share/vm/classfile/loaderConstraints.cpp b/hotspot/src/share/vm/classfile/loaderConstraints.cpp
index 5e25e4cbd02..8650cd98db6 100644
--- a/hotspot/src/share/vm/classfile/loaderConstraints.cpp
+++ b/hotspot/src/share/vm/classfile/loaderConstraints.cpp
@@ -31,7 +31,7 @@
#include "utilities/hashtable.inline.hpp"
LoaderConstraintTable::LoaderConstraintTable(int nof_buckets)
- : Hashtable(nof_buckets, sizeof(LoaderConstraintEntry)) {};
+ : Hashtable(nof_buckets, sizeof(LoaderConstraintEntry)) {};
LoaderConstraintEntry* LoaderConstraintTable::new_entry(
@@ -39,7 +39,7 @@ LoaderConstraintEntry* LoaderConstraintTable::new_entry(
klassOop klass, int num_loaders,
int max_loaders) {
LoaderConstraintEntry* entry;
- entry = (LoaderConstraintEntry*)Hashtable::new_entry(hash, klass);
+ entry = (LoaderConstraintEntry*)Hashtable::new_entry(hash, klass);
entry->set_name(name);
entry->set_num_loaders(num_loaders);
entry->set_max_loaders(max_loaders);
@@ -49,7 +49,7 @@ LoaderConstraintEntry* LoaderConstraintTable::new_entry(
void LoaderConstraintTable::free_entry(LoaderConstraintEntry *entry) {
// decrement name refcount before freeing
entry->name()->decrement_refcount();
- Hashtable::free_entry(entry);
+ Hashtable::free_entry(entry);
}
@@ -164,7 +164,7 @@ void LoaderConstraintTable::purge_loader_constraints(BoolObjectClosure* is_alive
// Purge entry
*p = probe->next();
- FREE_C_HEAP_ARRAY(oop, probe->loaders());
+ FREE_C_HEAP_ARRAY(oop, probe->loaders(), mtClass);
free_entry(probe);
} else {
#ifdef ASSERT
@@ -224,7 +224,7 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name,
int index = hash_to_index(hash);
LoaderConstraintEntry* p;
p = new_entry(hash, class_name, klass, 2, 2);
- p->set_loaders(NEW_C_HEAP_ARRAY(oop, 2));
+ p->set_loaders(NEW_C_HEAP_ARRAY(oop, 2, mtClass));
p->set_loader(0, class_loader1());
p->set_loader(1, class_loader2());
p->set_klass(klass);
@@ -340,10 +340,10 @@ void LoaderConstraintTable::ensure_loader_constraint_capacity(
int nfree) {
if (p->max_loaders() - p->num_loaders() < nfree) {
int n = nfree + p->num_loaders();
- oop* new_loaders = NEW_C_HEAP_ARRAY(oop, n);
+ oop* new_loaders = NEW_C_HEAP_ARRAY(oop, n, mtClass);
memcpy(new_loaders, p->loaders(), sizeof(oop) * p->num_loaders());
p->set_max_loaders(n);
- FREE_C_HEAP_ARRAY(oop, p->loaders());
+ FREE_C_HEAP_ARRAY(oop, p->loaders(), mtClass);
p->set_loaders(new_loaders);
}
}
@@ -425,7 +425,7 @@ void LoaderConstraintTable::merge_loader_constraints(
}
*pp2 = p2->next();
- FREE_C_HEAP_ARRAY(oop, p2->loaders());
+ FREE_C_HEAP_ARRAY(oop, p2->loaders(), mtClass);
free_entry(p2);
return;
}
diff --git a/hotspot/src/share/vm/classfile/loaderConstraints.hpp b/hotspot/src/share/vm/classfile/loaderConstraints.hpp
index 60612f5dba3..d01b2c4d63f 100644
--- a/hotspot/src/share/vm/classfile/loaderConstraints.hpp
+++ b/hotspot/src/share/vm/classfile/loaderConstraints.hpp
@@ -31,7 +31,7 @@
class LoaderConstraintEntry;
-class LoaderConstraintTable : public Hashtable {
+class LoaderConstraintTable : public Hashtable {
friend class VMStructs;
private:
@@ -53,11 +53,11 @@ public:
void free_entry(LoaderConstraintEntry *entry);
LoaderConstraintEntry* bucket(int i) {
- return (LoaderConstraintEntry*)Hashtable::bucket(i);
+ return (LoaderConstraintEntry*)Hashtable::bucket(i);
}
LoaderConstraintEntry** bucket_addr(int i) {
- return (LoaderConstraintEntry**)Hashtable::bucket_addr(i);
+ return (LoaderConstraintEntry**)Hashtable::bucket_addr(i);
}
// GC support
@@ -94,7 +94,7 @@ public:
#endif
};
-class LoaderConstraintEntry : public HashtableEntry {
+class LoaderConstraintEntry : public HashtableEntry {
friend class VMStructs;
private:
Symbol* _name; // class name
@@ -109,14 +109,14 @@ public:
void set_klass(klassOop k) { set_literal(k); }
LoaderConstraintEntry* next() {
- return (LoaderConstraintEntry*)HashtableEntry::next();
+ return (LoaderConstraintEntry*)HashtableEntry::next();
}
LoaderConstraintEntry** next_addr() {
- return (LoaderConstraintEntry**)HashtableEntry::next_addr();
+ return (LoaderConstraintEntry**)HashtableEntry::next_addr();
}
void set_next(LoaderConstraintEntry* next) {
- HashtableEntry::set_next(next);
+ HashtableEntry::set_next(next);
}
Symbol* name() { return _name; }
diff --git a/hotspot/src/share/vm/classfile/placeholders.cpp b/hotspot/src/share/vm/classfile/placeholders.cpp
index ef877b1033e..d3f425b241a 100644
--- a/hotspot/src/share/vm/classfile/placeholders.cpp
+++ b/hotspot/src/share/vm/classfile/placeholders.cpp
@@ -34,7 +34,7 @@
PlaceholderEntry* PlaceholderTable::new_entry(int hash, Symbol* name,
oop loader, bool havesupername,
Symbol* supername) {
- PlaceholderEntry* entry = (PlaceholderEntry*)Hashtable::new_entry(hash, name);
+ PlaceholderEntry* entry = (PlaceholderEntry*)Hashtable::new_entry(hash, name);
// Hashtable with Symbol* literal must increment and decrement refcount.
name->increment_refcount();
entry->set_loader(loader);
@@ -52,7 +52,7 @@ void PlaceholderTable::free_entry(PlaceholderEntry* entry) {
// decrement Symbol refcount here because Hashtable doesn't.
entry->literal()->decrement_refcount();
if (entry->supername() != NULL) entry->supername()->decrement_refcount();
- Hashtable::free_entry(entry);
+ Hashtable::free_entry(entry);
}
@@ -166,7 +166,7 @@ void PlaceholderTable::find_and_remove(int index, unsigned int hash,
}
PlaceholderTable::PlaceholderTable(int table_size)
- : TwoOopHashtable(table_size, sizeof(PlaceholderEntry)) {
+ : TwoOopHashtable(table_size, sizeof(PlaceholderEntry)) {
}
diff --git a/hotspot/src/share/vm/classfile/placeholders.hpp b/hotspot/src/share/vm/classfile/placeholders.hpp
index 667c59b8c70..4dea3a6804c 100644
--- a/hotspot/src/share/vm/classfile/placeholders.hpp
+++ b/hotspot/src/share/vm/classfile/placeholders.hpp
@@ -34,7 +34,7 @@ class PlaceholderEntry;
// being loaded, as well as arrays of primitives.
//
-class PlaceholderTable : public TwoOopHashtable {
+class PlaceholderTable : public TwoOopHashtable {
friend class VMStructs;
public:
@@ -44,15 +44,15 @@ public:
void free_entry(PlaceholderEntry* entry);
PlaceholderEntry* bucket(int i) {
- return (PlaceholderEntry*)Hashtable::bucket(i);
+ return (PlaceholderEntry*)Hashtable::bucket(i);
}
PlaceholderEntry** bucket_addr(int i) {
- return (PlaceholderEntry**)Hashtable::bucket_addr(i);
+ return (PlaceholderEntry**)Hashtable::bucket_addr(i);
}
void add_entry(int index, PlaceholderEntry* new_entry) {
- Hashtable::add_entry(index, (HashtableEntry*)new_entry);
+ Hashtable::add_entry(index, (HashtableEntry*)new_entry);
}
void add_entry(int index, unsigned int hash, Symbol* name,
@@ -116,7 +116,7 @@ public:
// For DEFINE_CLASS, the head of the queue owns the
// define token and the rest of the threads wait to return the
// result the first thread gets.
-class SeenThread: public CHeapObj {
+class SeenThread: public CHeapObj {
private:
Thread *_thread;
SeenThread* _stnext;
@@ -152,7 +152,7 @@ public:
// on store ordering here.
// The system dictionary is the only user of this class.
-class PlaceholderEntry : public HashtableEntry {
+class PlaceholderEntry : public HashtableEntry {
friend class VMStructs;
@@ -206,11 +206,11 @@ class PlaceholderEntry : public HashtableEntry {
void set_defineThreadQ(SeenThread* SeenThread) { _defineThreadQ = SeenThread; }
PlaceholderEntry* next() const {
- return (PlaceholderEntry*)HashtableEntry::next();
+ return (PlaceholderEntry*)HashtableEntry::next();
}
PlaceholderEntry** next_addr() {
- return (PlaceholderEntry**)HashtableEntry::next_addr();
+ return (PlaceholderEntry**)HashtableEntry::next_addr();
}
// Test for equality
diff --git a/hotspot/src/share/vm/classfile/resolutionErrors.cpp b/hotspot/src/share/vm/classfile/resolutionErrors.cpp
index ed31224e010..e94ffa288ab 100644
--- a/hotspot/src/share/vm/classfile/resolutionErrors.cpp
+++ b/hotspot/src/share/vm/classfile/resolutionErrors.cpp
@@ -67,7 +67,7 @@ void ResolutionErrorEntry::set_error(Symbol* e) {
ResolutionErrorEntry* ResolutionErrorTable::new_entry(int hash, constantPoolOop pool,
int cp_index, Symbol* error)
{
- ResolutionErrorEntry* entry = (ResolutionErrorEntry*)Hashtable::new_entry(hash, pool);
+ ResolutionErrorEntry* entry = (ResolutionErrorEntry*)Hashtable::new_entry(hash, pool);
entry->set_cp_index(cp_index);
NOT_PRODUCT(entry->set_error(NULL);)
entry->set_error(error);
@@ -79,13 +79,13 @@ void ResolutionErrorTable::free_entry(ResolutionErrorEntry *entry) {
// decrement error refcount
assert(entry->error() != NULL, "error should be set");
entry->error()->decrement_refcount();
- Hashtable::free_entry(entry);
+ Hashtable::free_entry(entry);
}
// create resolution error table
ResolutionErrorTable::ResolutionErrorTable(int table_size)
- : Hashtable(table_size, sizeof(ResolutionErrorEntry)) {
+ : Hashtable(table_size, sizeof(ResolutionErrorEntry)) {
}
// GC support
diff --git a/hotspot/src/share/vm/classfile/resolutionErrors.hpp b/hotspot/src/share/vm/classfile/resolutionErrors.hpp
index 03fcf4957bb..a18a55a2340 100644
--- a/hotspot/src/share/vm/classfile/resolutionErrors.hpp
+++ b/hotspot/src/share/vm/classfile/resolutionErrors.hpp
@@ -33,7 +33,7 @@ class ResolutionErrorEntry;
// ResolutionError objects are used to record errors encountered during
// constant pool resolution (JVMS 5.4.3).
-class ResolutionErrorTable : public Hashtable {
+class ResolutionErrorTable : public Hashtable {
public:
ResolutionErrorTable(int table_size);
@@ -42,15 +42,16 @@ public:
void free_entry(ResolutionErrorEntry *entry);
ResolutionErrorEntry* bucket(int i) {
- return (ResolutionErrorEntry*)Hashtable::bucket(i);
+ return (ResolutionErrorEntry*)Hashtable::bucket(i);
}
ResolutionErrorEntry** bucket_addr(int i) {
- return (ResolutionErrorEntry**)Hashtable::bucket_addr(i);
+ return (ResolutionErrorEntry**)Hashtable::bucket_addr(i);
}
void add_entry(int index, ResolutionErrorEntry* new_entry) {
- Hashtable::add_entry(index, (HashtableEntry*)new_entry);
+ Hashtable::add_entry(index,
+ (HashtableEntry*)new_entry);
}
void add_entry(int index, unsigned int hash,
@@ -74,7 +75,7 @@ public:
};
-class ResolutionErrorEntry : public HashtableEntry {
+class ResolutionErrorEntry : public HashtableEntry {
private:
int _cp_index;
Symbol* _error;
@@ -90,11 +91,11 @@ class ResolutionErrorEntry : public HashtableEntry {
void set_error(Symbol* e);
ResolutionErrorEntry* next() const {
- return (ResolutionErrorEntry*)HashtableEntry::next();
+ return (ResolutionErrorEntry*)HashtableEntry::next();
}
ResolutionErrorEntry** next_addr() {
- return (ResolutionErrorEntry**)HashtableEntry::next_addr();
+ return (ResolutionErrorEntry**)HashtableEntry::next_addr();
}
// GC support
diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp
index 3b6ec7ceb34..85cc5002d10 100644
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp
@@ -64,9 +64,9 @@ Symbol* SymbolTable::allocate_symbol(const u1* name, int len, bool c_heap, TRAPS
void SymbolTable::initialize_symbols(int arena_alloc_size) {
// Initialize the arena for global symbols, size passed in depends on CDS.
if (arena_alloc_size == 0) {
- _arena = new Arena();
+ _arena = new (mtSymbol) Arena();
} else {
- _arena = new Arena(arena_alloc_size);
+ _arena = new (mtSymbol) Arena(arena_alloc_size);
}
}
@@ -74,7 +74,7 @@ void SymbolTable::initialize_symbols(int arena_alloc_size) {
void SymbolTable::symbols_do(SymbolClosure *cl) {
const int n = the_table()->table_size();
for (int i = 0; i < n; i++) {
- for (HashtableEntry* p = the_table()->bucket(i);
+ for (HashtableEntry* p = the_table()->bucket(i);
p != NULL;
p = p->next()) {
cl->do_symbol(p->literal_addr());
@@ -92,8 +92,8 @@ void SymbolTable::unlink() {
int total = 0;
size_t memory_total = 0;
for (int i = 0; i < the_table()->table_size(); ++i) {
- HashtableEntry** p = the_table()->bucket_addr(i);
- HashtableEntry* entry = the_table()->bucket(i);
+ HashtableEntry** p = the_table()->bucket_addr(i);
+ HashtableEntry* entry = the_table()->bucket(i);
while (entry != NULL) {
// Shared entries are normally at the end of the bucket and if we run into
// a shared entry, then there is nothing more to remove. However, if we
@@ -117,7 +117,7 @@ void SymbolTable::unlink() {
p = entry->next_addr();
}
// get next entry
- entry = (HashtableEntry*)HashtableEntry::make_ptr(*p);
+ entry = (HashtableEntry*)HashtableEntry::make_ptr(*p);
}
}
symbols_removed += removed;
@@ -164,7 +164,7 @@ void SymbolTable::rehash_table() {
Symbol* SymbolTable::lookup(int index, const char* name,
int len, unsigned int hash) {
int count = 0;
- for (HashtableEntry* e = bucket(index); e != NULL; e = e->next()) {
+ for (HashtableEntry* e = bucket(index); e != NULL; e = e->next()) {
count++; // count all entries in this bucket, not just ones with same hash
if (e->hash() == hash) {
Symbol* sym = e->literal();
@@ -176,7 +176,7 @@ Symbol* SymbolTable::lookup(int index, const char* name,
}
}
// If the bucket size is too deep check if this hash code is insufficient.
- if (count >= BasicHashtable::rehash_count && !needs_rehashing()) {
+ if (count >= BasicHashtable::rehash_count && !needs_rehashing()) {
_needs_rehashing = check_rehash_table(count);
}
return NULL;
@@ -268,7 +268,7 @@ Symbol** SymbolTable::lookup_symbol_addr(Symbol* sym){
unsigned int hash = hash_symbol((char*)sym->bytes(), sym->utf8_length());
int index = the_table()->hash_to_index(hash);
- for (HashtableEntry* e = the_table()->bucket(index); e != NULL; e = e->next()) {
+ for (HashtableEntry* e = the_table()->bucket(index); e != NULL; e = e->next()) {
if (e->hash() == hash) {
Symbol* literal_sym = e->literal();
if (sym == literal_sym) {
@@ -387,7 +387,7 @@ Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len,
Symbol* sym = allocate_symbol(name, len, c_heap, CHECK_NULL);
assert(sym->equals((char*)name, len), "symbol must be properly initialized");
- HashtableEntry* entry = new_entry(hashValue, sym);
+ HashtableEntry* entry = new_entry(hashValue, sym);
add_entry(index, entry);
return sym;
}
@@ -435,7 +435,7 @@ bool SymbolTable::basic_add(Handle class_loader, constantPoolHandle cp,
bool c_heap = class_loader() != NULL;
Symbol* sym = allocate_symbol((const u1*)names[i], lengths[i], c_heap, CHECK_(false));
assert(sym->equals(names[i], lengths[i]), "symbol must be properly initialized"); // why wouldn't it be???
- HashtableEntry* entry = new_entry(hashValue, sym);
+ HashtableEntry* entry = new_entry(hashValue, sym);
add_entry(index, entry);
cp->symbol_at_put(cp_indices[i], sym);
}
@@ -446,7 +446,7 @@ bool SymbolTable::basic_add(Handle class_loader, constantPoolHandle cp,
void SymbolTable::verify() {
for (int i = 0; i < the_table()->table_size(); ++i) {
- HashtableEntry* p = the_table()->bucket(i);
+ HashtableEntry* p = the_table()->bucket(i);
for ( ; p != NULL; p = p->next()) {
Symbol* s = (Symbol*)(p->literal());
guarantee(s != NULL, "symbol is NULL");
@@ -462,7 +462,7 @@ void SymbolTable::dump(outputStream* st) {
NumberSeq summary;
for (int i = 0; i < the_table()->table_size(); ++i) {
int count = 0;
- for (HashtableEntry* e = the_table()->bucket(i);
+ for (HashtableEntry* e = the_table()->bucket(i);
e != NULL; e = e->next()) {
count++;
}
@@ -499,7 +499,7 @@ void SymbolTable::print_histogram() {
int memory_total = 0;
int count = 0;
for (i = 0; i < the_table()->table_size(); i++) {
- HashtableEntry* p = the_table()->bucket(i);
+ HashtableEntry* p = the_table()->bucket(i);
for ( ; p != NULL; p = p->next()) {
memory_total += p->literal()->object_size();
count++;
@@ -560,15 +560,15 @@ void SymbolTable::print_histogram() {
void SymbolTable::print() {
for (int i = 0; i < the_table()->table_size(); ++i) {
- HashtableEntry** p = the_table()->bucket_addr(i);
- HashtableEntry* entry = the_table()->bucket(i);
+ HashtableEntry** p = the_table()->bucket_addr(i);
+ HashtableEntry* entry = the_table()->bucket(i);
if (entry != NULL) {
while (entry != NULL) {
tty->print(PTR_FORMAT " ", entry->literal());
entry->literal()->print();
tty->print(" %d", entry->literal()->refcount());
p = entry->next_addr();
- entry = (HashtableEntry*)HashtableEntry::make_ptr(*p);
+ entry = (HashtableEntry*)HashtableEntry::make_ptr(*p);
}
tty->cr();
}
@@ -631,7 +631,7 @@ unsigned int StringTable::hash_string(const jchar* s, int len) {
oop StringTable::lookup(int index, jchar* name,
int len, unsigned int hash) {
int count = 0;
- for (HashtableEntry* l = bucket(index); l != NULL; l = l->next()) {
+ for (HashtableEntry* l = bucket(index); l != NULL; l = l->next()) {
count++;
if (l->hash() == hash) {
if (java_lang_String::equals(l->literal(), name, len)) {
@@ -640,7 +640,7 @@ oop StringTable::lookup(int index, jchar* name,
}
}
// If the bucket size is too deep check if this hash code is insufficient.
- if (count >= BasicHashtable::rehash_count && !needs_rehashing()) {
+ if (count >= BasicHashtable::rehash_count && !needs_rehashing()) {
_needs_rehashing = check_rehash_table(count);
}
return NULL;
@@ -676,7 +676,7 @@ oop StringTable::basic_add(int index_arg, Handle string, jchar* name,
return test;
}
- HashtableEntry* entry = new_entry(hashValue, string());
+ HashtableEntry* entry = new_entry(hashValue, string());
add_entry(index, entry);
return string();
}
@@ -761,8 +761,8 @@ void StringTable::unlink(BoolObjectClosure* is_alive) {
// entries at a safepoint.
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
for (int i = 0; i < the_table()->table_size(); ++i) {
- HashtableEntry** p = the_table()->bucket_addr(i);
- HashtableEntry* entry = the_table()->bucket(i);
+ HashtableEntry** p = the_table()->bucket_addr(i);
+ HashtableEntry* entry = the_table()->bucket(i);
while (entry != NULL) {
// Shared entries are normally at the end of the bucket and if we run into
// a shared entry, then there is nothing more to remove. However, if we
@@ -778,15 +778,15 @@ void StringTable::unlink(BoolObjectClosure* is_alive) {
*p = entry->next();
the_table()->free_entry(entry);
}
- entry = (HashtableEntry*)HashtableEntry::make_ptr(*p);
+ entry = (HashtableEntry*)HashtableEntry::make_ptr(*p);
}
}
}
void StringTable::oops_do(OopClosure* f) {
for (int i = 0; i < the_table()->table_size(); ++i) {
- HashtableEntry** p = the_table()->bucket_addr(i);
- HashtableEntry* entry = the_table()->bucket(i);
+ HashtableEntry** p = the_table()->bucket_addr(i);
+ HashtableEntry* entry = the_table()->bucket(i);
while (entry != NULL) {
f->do_oop((oop*)entry->literal_addr());
@@ -798,14 +798,14 @@ void StringTable::oops_do(OopClosure* f) {
} else {
p = entry->next_addr();
}
- entry = (HashtableEntry*)HashtableEntry::make_ptr(*p);
+ entry = (HashtableEntry*)HashtableEntry::make_ptr(*p);
}
}
}
void StringTable::verify() {
for (int i = 0; i < the_table()->table_size(); ++i) {
- HashtableEntry* p = the_table()->bucket(i);
+ HashtableEntry* p = the_table()->bucket(i);
for ( ; p != NULL; p = p->next()) {
oop s = p->literal();
guarantee(s != NULL, "interned string is NULL");
@@ -821,7 +821,7 @@ void StringTable::verify() {
void StringTable::dump(outputStream* st) {
NumberSeq summary;
for (int i = 0; i < the_table()->table_size(); ++i) {
- HashtableEntry* p = the_table()->bucket(i);
+ HashtableEntry* p = the_table()->bucket(i);
int count = 0;
for ( ; p != NULL; p = p->next()) {
count++;
diff --git a/hotspot/src/share/vm/classfile/symbolTable.hpp b/hotspot/src/share/vm/classfile/symbolTable.hpp
index 6e5782cd7ea..f63de80280e 100644
--- a/hotspot/src/share/vm/classfile/symbolTable.hpp
+++ b/hotspot/src/share/vm/classfile/symbolTable.hpp
@@ -71,7 +71,7 @@ class TempNewSymbol : public StackObj {
operator Symbol*() { return _temp; }
};
-class SymbolTable : public Hashtable {
+class SymbolTable : public Hashtable {
friend class VMStructs;
friend class ClassFileParser;
@@ -113,10 +113,10 @@ private:
Symbol* lookup(int index, const char* name, int len, unsigned int hash);
SymbolTable()
- : Hashtable(symbol_table_size, sizeof (HashtableEntry)) {}
+ : Hashtable(symbol_table_size, sizeof (HashtableEntry)) {}
- SymbolTable(HashtableBucket* t, int number_of_entries)
- : Hashtable(symbol_table_size, sizeof (HashtableEntry), t,
+ SymbolTable(HashtableBucket* t, int number_of_entries)
+ : Hashtable(symbol_table_size, sizeof (HashtableEntry), t,
number_of_entries) {}
// Arena for permanent symbols (null class loader) that are never unloaded
@@ -145,10 +145,10 @@ public:
initialize_symbols(symbol_alloc_arena_size);
}
- static void create_table(HashtableBucket* t, int length,
+ static void create_table(HashtableBucket* t, int length,
int number_of_entries) {
assert(_the_table == NULL, "One symbol table allowed.");
- assert(length == symbol_table_size * sizeof(HashtableBucket),
+ assert(length == symbol_table_size * sizeof(HashtableBucket),
"bad shared symbol size.");
_the_table = new SymbolTable(t, number_of_entries);
// if CDS give symbol table a default arena size since most symbols
@@ -224,13 +224,13 @@ public:
// Sharing
static void copy_buckets(char** top, char*end) {
- the_table()->Hashtable::copy_buckets(top, end);
+ the_table()->Hashtable::copy_buckets(top, end);
}
static void copy_table(char** top, char*end) {
- the_table()->Hashtable::copy_table(top, end);
+ the_table()->Hashtable::copy_table(top, end);
}
static void reverse(void* boundary = NULL) {
- the_table()->Hashtable::reverse(boundary);
+ the_table()->Hashtable::reverse(boundary);
}
// Rehash the symbol table if it gets out of balance
@@ -238,8 +238,7 @@ public:
static bool needs_rehashing() { return _needs_rehashing; }
};
-
-class StringTable : public Hashtable {
+class StringTable : public Hashtable {
friend class VMStructs;
private:
@@ -256,11 +255,11 @@ private:
oop lookup(int index, jchar* chars, int length, unsigned int hashValue);
- StringTable() : Hashtable((int)StringTableSize,
- sizeof (HashtableEntry)) {}
+ StringTable() : Hashtable((int)StringTableSize,
+ sizeof (HashtableEntry)) {}
- StringTable(HashtableBucket* t, int number_of_entries)
- : Hashtable