< prev index next >

src/hotspot/share/prims/jvmtiRedefineClasses.cpp

Print this page
rev 58565 : 8238358: Implementation of JEP 371: Hidden Classes
Reviewed-by: duke
Contributed-by: mandy.chung@oracle.com, lois.foltan@oracle.com, david.holmes@oracle.com, harold.seigel@oracle.com, serguei.spitsyn@oracle.com, alex.buckley@oracle.com, jamsheed.c.m@oracle.com

*** 148,159 **** _res = JVMTI_ERROR_NULL_POINTER; return false; } oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass); ! // classes for primitives and arrays and vm unsafe anonymous classes cannot be redefined ! // check here so following code can assume these classes are InstanceKlass if (!is_modifiable_class(mirror)) { _res = JVMTI_ERROR_UNMODIFIABLE_CLASS; return false; } } --- 148,160 ---- _res = JVMTI_ERROR_NULL_POINTER; return false; } oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass); ! // classes for primitives, arrays, hidden and vm unsafe anonymous classes ! // cannot be redefined. Check here so following code can assume these classes ! // are InstanceKlass. if (!is_modifiable_class(mirror)) { _res = JVMTI_ERROR_UNMODIFIABLE_CLASS; return false; } }
*** 291,302 **** // classes for arrays cannot be redefined if (k == NULL || !k->is_instance_klass()) { return false; } ! // Cannot redefine or retransform an unsafe anonymous class. ! if (InstanceKlass::cast(k)->is_unsafe_anonymous()) { return false; } return true; } --- 292,304 ---- // classes for arrays cannot be redefined if (k == NULL || !k->is_instance_klass()) { return false; } ! // Cannot redefine or retransform a hidden or an unsafe anonymous class. ! if (InstanceKlass::cast(k)->is_hidden() || ! InstanceKlass::cast(k)->is_unsafe_anonymous()) { return false; } return true; }
*** 1237,1251 **** // Set redefined class handle in JvmtiThreadState class. // This redefined class is sent to agent event handler for class file // load hook event. state->set_class_being_redefined(the_class, _class_load_kind); InstanceKlass* scratch_class = SystemDictionary::parse_stream( the_class_sym, the_class_loader, - protection_domain, &st, THREAD); // Clear class_being_redefined just to be sure. state->clear_class_being_redefined(); // TODO: if this is retransform, and nothing changed we can skip it --- 1239,1254 ---- // Set redefined class handle in JvmtiThreadState class. // This redefined class is sent to agent event handler for class file // load hook event. state->set_class_being_redefined(the_class, _class_load_kind); + ClassLoadInfo cl_info(protection_domain); InstanceKlass* scratch_class = SystemDictionary::parse_stream( the_class_sym, the_class_loader, &st, + cl_info, THREAD); // Clear class_being_redefined just to be sure. state->clear_class_being_redefined(); // TODO: if this is retransform, and nothing changed we can skip it
< prev index next >