changeset 10261:9b77ca4ce35e

Merge
author dholmes
date Wed, 08 May 2013 19:38:41 -0400
parents 711016f146fd (current diff) 0dc028fd5101 (diff)
children c272092594bd
files src/share/vm/runtime/arguments.cpp
diffstat 6 files changed, 64 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java	Wed May 08 19:28:54 2013 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java	Wed May 08 19:38:41 2013 -0400
@@ -97,8 +97,8 @@
                   holder.getName().asString() + " " +
                   OopUtilities.escapeString(method.getName().asString()) + " " +
                   method.getSignature().asString() + " " +
-                  method.getInvocationCounter() + " " +
-                  method.getBackedgeCounter() + " " +
+                  method.getInvocationCount() + " " +
+                  method.getBackedgeCount() + " " +
                   interpreterInvocationCount() + " " +
                   interpreterThrowoutCount() + " " +
                   instructionsSize());
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java	Wed May 08 19:28:54 2013 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java	Wed May 08 19:38:41 2013 -0400
@@ -24,15 +24,21 @@
 
 package sun.jvm.hotspot.oops;
 
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.code.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.interpreter.*;
-import sun.jvm.hotspot.memory.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-import sun.jvm.hotspot.utilities.*;
+import java.io.PrintStream;
+import java.util.Observable;
+import java.util.Observer;
+
+import sun.jvm.hotspot.code.NMethod;
+import sun.jvm.hotspot.debugger.Address;
+import sun.jvm.hotspot.interpreter.OopMapCacheEntry;
+import sun.jvm.hotspot.runtime.SignatureConverter;
+import sun.jvm.hotspot.runtime.VM;
+import sun.jvm.hotspot.runtime.VMObjectFactory;
+import sun.jvm.hotspot.types.AddressField;
+import sun.jvm.hotspot.types.Type;
+import sun.jvm.hotspot.types.TypeDataBase;
+import sun.jvm.hotspot.types.WrongTypeException;
+import sun.jvm.hotspot.utilities.Assert;
 
 // A Method represents a Java method
 
@@ -132,11 +138,13 @@
   public long         getAccessFlags()                { return                accessFlags.getValue(this);       }
   public long         getCodeSize()                   { return                getConstMethod().getCodeSize();   }
   public long         getVtableIndex()                { return                vtableIndex.getValue(this);       }
-  public long         getInvocationCounter()          {
-    return getMethodCounters().getInvocationCounter();
+  public long         getInvocationCount()          {
+    MethodCounters mc = getMethodCounters();
+    return mc == null ? 0 : mc.getInvocationCounter();
   }
-  public long         getBackedgeCounter()          {
-    return getMethodCounters().getBackedgeCounter();
+  public long         getBackedgeCount()          {
+    MethodCounters mc = getMethodCounters();
+    return mc == null ? 0 : mc.getBackedgeCounter();
   }
 
   // get associated compiled native method, if available, else return null.
@@ -349,8 +357,8 @@
                   holder.getName().asString() + " " +
                   OopUtilities.escapeString(getName().asString()) + " " +
                   getSignature().asString() + " " +
-                  getInvocationCounter() + " " +
-                  getBackedgeCounter() + " " +
+                  getInvocationCount() + " " +
+                  getBackedgeCount() + " " +
                   interpreterInvocationCount() + " " +
                   interpreterThrowoutCount() + " " +
                   code_size);
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java	Wed May 08 19:28:54 2013 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java	Wed May 08 19:38:41 2013 -0400
@@ -316,8 +316,8 @@
     int iic = method.interpreterInvocationCount();
     if (mileage < iic)  mileage = iic;
 
-    long ic = method.getInvocationCounter();
-    long bc = method.getBackedgeCounter();
+    long ic = method.getInvocationCount();
+    long bc = method.getBackedgeCount();
 
     long icval = ic >> 3;
     if ((ic & 4) != 0) icval += CompileThreshold;
--- a/src/share/vm/code/nmethod.cpp	Wed May 08 19:28:54 2013 -0400
+++ b/src/share/vm/code/nmethod.cpp	Wed May 08 19:38:41 2013 -0400
@@ -1794,6 +1794,19 @@
           Metadata* md = r->metadata_value();
           f(md);
         }
+      } else if (iter.type() == relocInfo::virtual_call_type) {
+        // Check compiledIC holders associated with this nmethod
+        CompiledIC *ic = CompiledIC_at(iter.reloc());
+        if (ic->is_icholder_call()) {
+          CompiledICHolder* cichk = ic->cached_icholder();
+          f(cichk->holder_method());
+          f(cichk->holder_klass());
+        } else {
+          Metadata* ic_oop = ic->cached_metadata();
+          if (ic_oop != NULL) {
+            f(ic_oop);
+          }
+        }
       }
     }
   }
@@ -1804,6 +1817,7 @@
     Metadata* md = *p;
     f(md);
   }
+
   // Call function Method*, not embedded in these other places.
   if (_method != NULL) f(_method);
 }
--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp	Wed May 08 19:28:54 2013 -0400
+++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp	Wed May 08 19:38:41 2013 -0400
@@ -3366,6 +3366,10 @@
   }
 #endif
 
+  // NULL out in scratch class to not delete twice.  The class to be redefined
+  // always owns these bytes.
+  scratch_class->set_cached_class_file(NULL, 0);
+
   // Replace inner_classes
   Array<u2>* old_inner_classes = the_class->inner_classes();
   the_class->set_inner_classes(scratch_class->inner_classes());
--- a/src/share/vm/runtime/arguments.cpp	Wed May 08 19:28:54 2013 -0400
+++ b/src/share/vm/runtime/arguments.cpp	Wed May 08 19:38:41 2013 -0400
@@ -3104,36 +3104,27 @@
 }
 
 void Arguments::set_shared_spaces_flags() {
-  const bool must_share = DumpSharedSpaces || RequireSharedSpaces;
-  const bool might_share = must_share || UseSharedSpaces;
-
-  // CompressedOops cannot be used with CDS.  The offsets of oopmaps and
-  // static fields are incorrect in the archive.  With some more clever
-  // initialization, this restriction can probably be lifted.
-  // ??? UseLargePages might be okay now
-  const bool cannot_share = UseCompressedOops ||
-                            (UseLargePages && FLAG_IS_CMDLINE(UseLargePages));
-  if (cannot_share) {
-    if (must_share) {
-        warning("disabling large pages %s"
-                "because of %s", "" LP64_ONLY("and compressed oops "),
-                DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
-        FLAG_SET_CMDLINE(bool, UseLargePages, false);
-        LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false));
-        LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false));
-    } else {
-      // Prefer compressed oops and large pages to class data sharing
-      if (UseSharedSpaces && Verbose) {
-        warning("turning off use of shared archive because of large pages%s",
-                 "" LP64_ONLY(" and/or compressed oops"));
+#ifdef _LP64
+    const bool must_share = DumpSharedSpaces || RequireSharedSpaces;
+
+    // CompressedOops cannot be used with CDS.  The offsets of oopmaps and
+    // static fields are incorrect in the archive.  With some more clever
+    // initialization, this restriction can probably be lifted.
+    if (UseCompressedOops) {
+      if (must_share) {
+          warning("disabling compressed oops because of %s",
+                  DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
+          FLAG_SET_CMDLINE(bool, UseCompressedOops, false);
+          FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false);
+      } else {
+        // Prefer compressed oops to class data sharing
+        if (UseSharedSpaces && Verbose) {
+          warning("turning off use of shared archive because of compressed oops");
+        }
+        no_shared_spaces();
       }
-      no_shared_spaces();
     }
-  } else if (UseLargePages && might_share) {
-    // Disable large pages to allow shared spaces.  This is sub-optimal, since
-    // there may not even be a shared archive to use.
-    FLAG_SET_DEFAULT(UseLargePages, false);
-  }
+#endif
 
   if (DumpSharedSpaces) {
     if (RequireSharedSpaces) {