comparison src/share/vm/code/oopRecorder.cpp @ 17376:9928ad27a80e

OopRecorder should check for duplicates
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 08 Oct 2014 11:48:00 -0700
parents da91efe96a93
children 44b83285b645
comparison
equal deleted inserted replaced
17375:467ffc7f01cb 17376:9928ad27a80e
32 32
33 #ifdef ASSERT 33 #ifdef ASSERT
34 template <class T> int ValueRecorder<T>::_find_index_calls = 0; 34 template <class T> int ValueRecorder<T>::_find_index_calls = 0;
35 template <class T> int ValueRecorder<T>::_hit_indexes = 0; 35 template <class T> int ValueRecorder<T>::_hit_indexes = 0;
36 template <class T> int ValueRecorder<T>::_missed_indexes = 0; 36 template <class T> int ValueRecorder<T>::_missed_indexes = 0;
37
38 void OopRecorder::check_for_duplicates(int index, jobject h) {
39 oop o = JNIHandles::resolve(h);
40 for (int i = 1; i < oop_count(); i++) {
41 if (o == JNIHandles::resolve(oop_at(i)) && index != i) {
42 assert(false, "duplicate found");
43 }
44 }
45 }
37 #endif //ASSERT 46 #endif //ASSERT
38
39 47
40 template <class T> ValueRecorder<T>::ValueRecorder(Arena* arena) { 48 template <class T> ValueRecorder<T>::ValueRecorder(Arena* arena) {
41 _handles = NULL; 49 _handles = NULL;
42 _indexes = NULL; 50 _indexes = NULL;
43 _arena = arena; 51 _arena = arena;