aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzgu <none@none>2012-11-28 06:42:03 -0800
committerzgu <none@none>2012-11-28 06:42:03 -0800
commit28dd9ee8e7cba245a38b347ad3735d11bb22369a (patch)
tree56a52512539b2eae0d8f85d4259939d0037e9b49 /src
parent8230970c12ca541dc9438a38632dbab337386d6c (diff)
parent851a44a995de1a970898045138f2242353d90c1e (diff)
Merge
Diffstat (limited to 'src')
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp3
-rw-r--r--src/share/vm/prims/jni.cpp6
-rw-r--r--src/share/vm/runtime/vmStructs.cpp17
-rw-r--r--src/share/vm/runtime/vmStructs.hpp5
4 files changed, 27 insertions, 4 deletions
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp b/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp
index b722779b8..a67e19d89 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp
@@ -65,8 +65,7 @@ typedef BinaryTreeDictionary<FreeChunk, AdaptiveFreeList> AFLBinaryTreeDictionar
declare_toplevel_type(AFLBinaryTreeDictionary*) \
declare_toplevel_type(LinearAllocBlock) \
declare_toplevel_type(FreeBlockDictionary<FreeChunk>) \
- declare_type(AFLBinaryTreeDictionary, FreeBlockDictionary<FreeChunk>) \
- declare_type(AFLBinaryTreeDictionary, FreeBlockDictionary<FreeChunk>) \
+ declare_type(AFLBinaryTreeDictionary, FreeBlockDictionary<FreeChunk>)
#define VM_INT_CONSTANTS_CMS(declare_constant) \
declare_constant(Generation::ConcurrentMarkSweep) \
diff --git a/src/share/vm/prims/jni.cpp b/src/share/vm/prims/jni.cpp
index 2204c4aba..e9d7d7bcd 100644
--- a/src/share/vm/prims/jni.cpp
+++ b/src/share/vm/prims/jni.cpp
@@ -5044,6 +5044,9 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *args_) {
#include "gc_interface/collectedHeap.hpp"
#include "utilities/quickSort.hpp"
+#if INCLUDE_VM_STRUCTS
+#include "runtime/vmStructs.hpp"
+#endif
#define run_unit_test(unit_test_function_call) \
tty->print_cr("Running test: " #unit_test_function_call); \
@@ -5056,6 +5059,9 @@ void execute_internal_vm_tests() {
run_unit_test(CollectedHeap::test_is_in());
run_unit_test(QuickSort::test_quick_sort());
run_unit_test(AltHashing::test_alt_hash());
+#if INCLUDE_VM_STRUCTS
+ run_unit_test(VMStructs::test());
+#endif
tty->print_cr("All internal VM tests passed");
}
}
diff --git a/src/share/vm/runtime/vmStructs.cpp b/src/share/vm/runtime/vmStructs.cpp
index 484566125..454a1e52f 100644
--- a/src/share/vm/runtime/vmStructs.cpp
+++ b/src/share/vm/runtime/vmStructs.cpp
@@ -2107,8 +2107,7 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
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 @@ VMStructs::findType(const char* typeName) {
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
diff --git a/src/share/vm/runtime/vmStructs.hpp b/src/share/vm/runtime/vmStructs.hpp
index 725399e2c..b1070a406 100644
--- a/src/share/vm/runtime/vmStructs.hpp
+++ b/src/share/vm/runtime/vmStructs.hpp
@@ -123,6 +123,11 @@ public:
// the data structure (debug build only)
static void init();
+#ifndef PRODUCT
+ // Execute unit tests
+ static void test();
+#endif
+
private:
// Look up a type in localHotSpotVMTypes using strcmp() (debug build only).
// Returns 1 if found, 0 if not.