8148195: Some InstanceKlass and MethodCounters fields can be excluded when JVMTI is not supported

Removed "previous version", "cached class file",  and breakpoint related fields and code when JVMTI is not supported

Reviewed-by: coleenp, sspitsyn
This commit is contained in:
Chris Plummer 2016-04-21 20:49:11 -07:00
parent d1b219ba3c
commit 7cd3700010
10 changed files with 103 additions and 18 deletions

View file

@ -2032,10 +2032,11 @@ bool InstanceKlass::check_sharing_error_state() {
return (old_state != is_in_error_state());
}
#if INCLUDE_JVMTI
static void clear_all_breakpoints(Method* m) {
m->clear_all_breakpoints();
}
#endif
void InstanceKlass::notify_unload_class(InstanceKlass* ik) {
// notify the debugger
@ -2097,6 +2098,7 @@ void InstanceKlass::release_C_heap_structures() {
// DC::remove_all_dependents() when it touches unloaded nmethod.
dependencies().wipe();
#if INCLUDE_JVMTI
// Deallocate breakpoint records
if (breakpoints() != 0x0) {
methods_do(clear_all_breakpoints);
@ -2108,6 +2110,7 @@ void InstanceKlass::release_C_heap_structures() {
os::free(_cached_class_file);
_cached_class_file = NULL;
}
#endif
// Decrement symbol reference counts associated with the unloaded class.
if (_name != NULL) _name->decrement_refcount();
@ -2841,7 +2844,7 @@ void InstanceKlass::print_on(outputStream* st) const {
{
bool have_pv = false;
// previous versions are linked together through the InstanceKlass
for (InstanceKlass* pv_node = _previous_versions;
for (InstanceKlass* pv_node = previous_versions();
pv_node != NULL;
pv_node = pv_node->previous_versions()) {
if (!have_pv)
@ -3334,7 +3337,7 @@ void InstanceKlass::set_init_state(ClassState state) {
}
#endif
#if INCLUDE_JVMTI
// RedefineClasses() support for previous versions:
int InstanceKlass::_previous_version_count = 0;
@ -3549,6 +3552,7 @@ void InstanceKlass::add_previous_version(instanceKlassHandle scratch_class,
_previous_version_count++;
} // end add_previous_version()
#endif // INCLUDE_JVMTI
Method* InstanceKlass::method_with_idnum(int idnum) {
Method* m = NULL;
@ -3598,7 +3602,7 @@ Method* InstanceKlass::method_with_orig_idnum(int idnum, int version) {
return method;
}
#if INCLUDE_JVMTI
jint InstanceKlass::get_cached_class_file_len() {
return VM_RedefineClasses::get_cached_class_file_len(_cached_class_file);
}
@ -3606,3 +3610,4 @@ jint InstanceKlass::get_cached_class_file_len() {
unsigned char * InstanceKlass::get_cached_class_file_bytes() {
return VM_RedefineClasses::get_cached_class_file_bytes(_cached_class_file);
}
#endif