diff src/share/vm/runtime/vmStructs.cpp @ 7171:7c15faa95ce7

8003879: Duplicate definitions in vmStructs Summary: Removed duplicate entries Reviewed-by: dholmes, sspitsyn
author mikael
date Tue, 27 Nov 2012 07:57:57 -0800
parents bd7a7ce2e264
children c24f778e9401
line wrap: on
line diff
--- a/src/share/vm/runtime/vmStructs.cpp	Wed Nov 21 21:26:12 2012 -0500
+++ b/src/share/vm/runtime/vmStructs.cpp	Tue Nov 27 07:57:57 2012 -0800
@@ -2107,8 +2107,7 @@
   declare_toplevel_type(FreeList<Metablock>*)                             \
   declare_toplevel_type(FreeList<Metablock>)                              \
   declare_toplevel_type(MetablockTreeDictionary*)                         \
-  declare_type(MetablockTreeDictionary, FreeBlockDictionary<Metablock>)   \
-              declare_type(MetablockTreeDictionary, FreeBlockDictionary<Metablock>)
+           declare_type(MetablockTreeDictionary, FreeBlockDictionary<Metablock>)
 
 
   /* NOTE that we do not use the last_entry() macro here; it is used  */
@@ -3215,3 +3214,17 @@
 void vmStructs_init() {
   debug_only(VMStructs::init());
 }
+
+#ifndef PRODUCT
+void VMStructs::test() {
+  // Check for duplicate entries in type array
+  for (int i = 0; localHotSpotVMTypes[i].typeName != NULL; i++) {
+    for (int j = i + 1; localHotSpotVMTypes[j].typeName != NULL; j++) {
+      if (strcmp(localHotSpotVMTypes[i].typeName, localHotSpotVMTypes[j].typeName) == 0) {
+        tty->print_cr("Duplicate entries for '%s'", localHotSpotVMTypes[i].typeName);
+        assert(false, "Duplicate types in localHotSpotVMTypes array");
+      }
+    }
+  }
+}
+#endif