src/share/vm/runtime/sharedRuntime.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/runtime/sharedRuntime.cpp Tue Feb 16 15:43:06 2010
--- new/src/share/vm/runtime/sharedRuntime.cpp Tue Feb 16 15:43:06 2010
*** 1945,1955 ****
--- 1945,1955 ----
class AdapterHandlerTable : public BasicHashtable {
friend class AdapterHandlerTableIterator;
private:
! #ifdef ASSERT
! #ifndef PRODUCT
static int _lookups; // number of calls to lookup
static int _buckets; // number of buckets checked
static int _equals; // number of buckets checked with matching hash
static int _hits; // number of successful lookups
static int _compact; // number of equals calls with compact signature
*** 1981,2000 ****
--- 1981,2000 ----
BasicHashtable::free_entry(entry);
}
// Find a entry with the same fingerprint if it exists
AdapterHandlerEntry* lookup(int total_args_passed, BasicType* sig_bt) {
! debug_only(_lookups++);
! NOT_PRODUCT(_lookups++);
AdapterFingerPrint fp(total_args_passed, sig_bt);
unsigned int hash = fp.compute_hash();
int index = hash_to_index(hash);
for (AdapterHandlerEntry* e = bucket(index); e != NULL; e = e->next()) {
! debug_only(_buckets++);
! NOT_PRODUCT(_buckets++);
if (e->hash() == hash) {
! debug_only(_equals++);
! NOT_PRODUCT(_equals++);
if (fp.equals(e->fingerprint())) {
! #ifdef ASSERT
! #ifndef PRODUCT
if (fp.is_compact()) _compact++;
_hits++;
#endif
return e;
}
*** 2001,2010 ****
--- 2001,2011 ----
}
}
return NULL;
}
+ #ifndef PRODUCT
void print_statistics() {
ResourceMark rm;
int longest = 0;
int empty = 0;
int total = 0;
*** 2019,2037 ****
--- 2020,2037 ----
if (count > longest) longest = count;
total += count;
}
tty->print_cr("AdapterHandlerTable: empty %d longest %d total %d average %f",
empty, longest, total, total / (double)nonempty);
#ifdef ASSERT
tty->print_cr("AdapterHandlerTable: lookups %d buckets %d equals %d hits %d compact %d",
_lookups, _buckets, _equals, _hits, _compact);
#endif
}
+ #endif
};
! #ifdef ASSERT
! #ifndef PRODUCT
int AdapterHandlerTable::_lookups;
int AdapterHandlerTable::_buckets;
int AdapterHandlerTable::_equals;
int AdapterHandlerTable::_hits;
src/share/vm/runtime/sharedRuntime.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File