--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java Tue Nov 13 21:43:10 2018 -0500
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java Wed Nov 07 19:40:27 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -26,6 +26,7 @@
import java.io.*;
import java.util.*;
+import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.utilities.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
@@ -87,4 +88,12 @@
public void dumpReplayData(PrintStream out) {
out.println("# Unknown Metadata");
}
+
+ public boolean isShared() {
+ VM vm = VM.getVM();
+ if (vm.isSharingEnabled()) {
+ return MetaspaceObj.isShared(getAddress());
+ }
+ return false;
+ }
}