mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8003879: Duplicate definitions in vmStructs
Removed duplicate entries Reviewed-by: dholmes, sspitsyn
This commit is contained in:
parent
68137e4136
commit
8c32bcb315
4 changed files with 27 additions and 4 deletions
|
@ -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) \
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2107,7 +2107,6 @@ 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>)
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue