diff src/share/vm/oops/klass.cpp @ 11173:6b0fd0964b87

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Wed, 31 Jul 2013 11:00:54 +0200
parents 836a62f43af9 71180a6e5080
children cefad50507d8
line wrap: on
line diff
--- a/src/share/vm/oops/klass.cpp	Tue Jul 30 13:03:28 2013 -0700
+++ b/src/share/vm/oops/klass.cpp	Wed Jul 31 11:00:54 2013 +0200
@@ -168,7 +168,6 @@
   set_subklass(NULL);
   set_next_sibling(NULL);
   set_next_link(NULL);
-  set_alloc_count(0);
   TRACE_INIT_ID(this);
 
   set_prototype_header(markOopDesc::prototype());
@@ -377,7 +376,6 @@
 }
 
 bool Klass::is_loader_alive(BoolObjectClosure* is_alive) {
-  assert(is_metadata(), "p is not meta-data");
   assert(ClassLoaderDataGraph::contains((address)this), "is in the metaspace");
 
 #ifdef ASSERT
@@ -544,12 +542,6 @@
   return NULL;
 }
 
-
-void Klass::with_array_klasses_do(void f(Klass* k)) {
-  f(this);
-}
-
-
 oop Klass::class_loader() const { return class_loader_data()->class_loader(); }
 
 const char* Klass::external_name() const {
@@ -648,27 +640,24 @@
 
 // Verification
 
-void Klass::verify_on(outputStream* st) {
-  guarantee(!Universe::heap()->is_in_reserved(this), "Shouldn't be");
-  guarantee(this->is_metadata(), "should be in metaspace");
+void Klass::verify_on(outputStream* st, bool check_dictionary) {
 
+  // This can be expensive, but it is worth checking that this klass is actually
+  // in the CLD graph but not in production.
   assert(ClassLoaderDataGraph::contains((address)this), "Should be");
 
   guarantee(this->is_klass(),"should be klass");
 
   if (super() != NULL) {
-    guarantee(super()->is_metadata(), "should be in metaspace");
     guarantee(super()->is_klass(), "should be klass");
   }
   if (secondary_super_cache() != NULL) {
     Klass* ko = secondary_super_cache();
-    guarantee(ko->is_metadata(), "should be in metaspace");
     guarantee(ko->is_klass(), "should be klass");
   }
   for ( uint i = 0; i < primary_super_limit(); i++ ) {
     Klass* ko = _primary_supers[i];
     if (ko != NULL) {
-      guarantee(ko->is_metadata(), "should be in metaspace");
       guarantee(ko->is_klass(), "should be klass");
     }
   }
@@ -680,7 +669,6 @@
 
 void Klass::oop_verify_on(oop obj, outputStream* st) {
   guarantee(obj->is_oop(),  "should be oop");
-  guarantee(obj->klass()->is_metadata(), "should not be in Java heap");
   guarantee(obj->klass()->is_klass(), "klass field is not a klass");
 }