281 } |
281 } |
282 if (!k_mirror->is_a(SystemDictionary::Class_klass())) { |
282 if (!k_mirror->is_a(SystemDictionary::Class_klass())) { |
283 return JVMTI_ERROR_INVALID_CLASS; |
283 return JVMTI_ERROR_INVALID_CLASS; |
284 } |
284 } |
285 |
285 |
286 if (java_lang_Class::is_primitive(k_mirror)) { |
286 if (!VM_RedefineClasses::is_modifiable_class(k_mirror)) { |
287 return JVMTI_ERROR_UNMODIFIABLE_CLASS; |
287 return JVMTI_ERROR_UNMODIFIABLE_CLASS; |
288 } |
288 } |
289 |
289 |
290 Klass* k_oop = java_lang_Class::as_Klass(k_mirror); |
290 Klass* k_oop = java_lang_Class::as_Klass(k_mirror); |
291 KlassHandle klass(current_thread, k_oop); |
291 KlassHandle klass(current_thread, k_oop); |
292 |
292 |
293 jint status = klass->jvmti_class_status(); |
293 jint status = klass->jvmti_class_status(); |
294 if (status & (JVMTI_CLASS_STATUS_ERROR)) { |
294 if (status & (JVMTI_CLASS_STATUS_ERROR)) { |
295 return JVMTI_ERROR_INVALID_CLASS; |
295 return JVMTI_ERROR_INVALID_CLASS; |
296 } |
|
297 if (status & (JVMTI_CLASS_STATUS_ARRAY)) { |
|
298 return JVMTI_ERROR_UNMODIFIABLE_CLASS; |
|
299 } |
296 } |
300 |
297 |
301 instanceKlassHandle ikh(current_thread, k_oop); |
298 instanceKlassHandle ikh(current_thread, k_oop); |
302 if (ikh->get_cached_class_file_bytes() == NULL) { |
299 if (ikh->get_cached_class_file_bytes() == NULL) { |
303 // Not cached, we need to reconstitute the class file from the |
300 // Not cached, we need to reconstitute the class file from the |