aboutsummaryrefslogtreecommitdiff
path: root/agent
diff options
context:
space:
mode:
authortschatzl <none@none>2013-10-09 10:57:01 +0200
committertschatzl <none@none>2013-10-09 10:57:01 +0200
commit37e25f095dfe997ffdaf80f2f09af6a61565b7b7 (patch)
tree6765306eb95f66d0ccbe18dda7d4834ccdf14152 /agent
parent048ab137b31c731e1bf8efe0a2d9f2ada345f23b (diff)
downloadjdk8u_hotspot-37e25f095dfe997ffdaf80f2f09af6a61565b7b7.tar.gz
8003420: NPG: make new GC root for pd_set
Summary: Move protection domain oops from system dictionary entries into a seperate set; the system dictionary references entries in that set now. This allows fast iteration during non-classunloading garbage collection. Implementation based on initial prototype from Ioi Lam (iklam). Reviewed-by: coleenp, iklam
Diffstat (limited to 'agent')
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java56
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java12
2 files changed, 63 insertions, 5 deletions
diff --git a/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java b/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java
new file mode 100644
index 000000000..2c9e736ec
--- /dev/null
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2001, 2013, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.memory;
+
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.oops.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+
+public class ProtectionDomainCacheEntry extends VMObject {
+ private static sun.jvm.hotspot.types.OopField protectionDomainField;
+
+ static {
+ VM.registerVMInitializedObserver(new Observer() {
+ public void update(Observable o, Object data) {
+ initialize(VM.getVM().getTypeDataBase());
+ }
+ });
+ }
+
+ private static synchronized void initialize(TypeDataBase db) {
+ Type type = db.lookupType("ProtectionDomainCacheEntry");
+ protectionDomainField = type.getOopField("_literal");
+ }
+
+ public ProtectionDomainCacheEntry(Address addr) {
+ super(addr);
+ }
+
+ public Oop protectionDomain() {
+ return VM.getVM().getObjectHeap().newOop(protectionDomainField.getValue(addr));
+ }
+}
diff --git a/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java b/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java
index de2da04f9..27aa4e9f4 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, 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
@@ -32,7 +32,7 @@ import sun.jvm.hotspot.types.*;
public class ProtectionDomainEntry extends VMObject {
private static AddressField nextField;
- private static sun.jvm.hotspot.types.OopField protectionDomainField;
+ private static AddressField pdCacheField;
static {
VM.registerVMInitializedObserver(new Observer() {
@@ -46,7 +46,7 @@ public class ProtectionDomainEntry extends VMObject {
Type type = db.lookupType("ProtectionDomainEntry");
nextField = type.getAddressField("_next");
- protectionDomainField = type.getOopField("_protection_domain");
+ pdCacheField = type.getAddressField("_pd_cache");
}
public ProtectionDomainEntry(Address addr) {
@@ -54,10 +54,12 @@ public class ProtectionDomainEntry extends VMObject {
}
public ProtectionDomainEntry next() {
- return (ProtectionDomainEntry) VMObjectFactory.newObject(ProtectionDomainEntry.class, addr);
+ return (ProtectionDomainEntry) VMObjectFactory.newObject(ProtectionDomainEntry.class, nextField.getValue(addr));
}
public Oop protectionDomain() {
- return VM.getVM().getObjectHeap().newOop(protectionDomainField.getValue(addr));
+ ProtectionDomainCacheEntry pd_cache = (ProtectionDomainCacheEntry)
+ VMObjectFactory.newObject(ProtectionDomainCacheEntry.class, pdCacheField.getValue(addr));
+ return pd_cache.protectionDomain();
}
}