comparison src/share/vm/prims/jvmtiExport.cpp @ 10299:f49e0508a38a

4965252: JvmtiExport::post_raw_field_modification jni ref handling is odd Reviewed-by: coleenp, sspitsyn
author rbackman
date Wed, 15 May 2013 11:30:54 +0200
parents 0b7f78069732
children 825e6cb66923
comparison
equal deleted inserted replaced
10272:513a5298c1dd 10299:f49e0508a38a
1622 break; 1622 break;
1623 } 1623 }
1624 } 1624 }
1625 } 1625 }
1626 1626
1627 assert(sig_type != '[', "array should have sig_type == 'L'");
1628 bool handle_created = false;
1629
1627 // convert oop to JNI handle. 1630 // convert oop to JNI handle.
1628 if (sig_type == 'L' || sig_type == '[') { 1631 if (sig_type == 'L') {
1632 handle_created = true;
1629 value->l = (jobject)JNIHandles::make_local(thread, (oop)value->l); 1633 value->l = (jobject)JNIHandles::make_local(thread, (oop)value->l);
1630 } 1634 }
1631 1635
1632 post_field_modification(thread, method, location, field_klass, object, field, sig_type, value); 1636 post_field_modification(thread, method, location, field_klass, object, field, sig_type, value);
1633 1637
1634 // Destroy the JNI handle allocated above. 1638 // Destroy the JNI handle allocated above.
1635 if (sig_type == 'L') { 1639 if (handle_created) {
1636 JNIHandles::destroy_local(value->l); 1640 JNIHandles::destroy_local(value->l);
1637 } 1641 }
1638 } 1642 }
1639 1643
1640 void JvmtiExport::post_field_modification(JavaThread *thread, Method* method, 1644 void JvmtiExport::post_field_modification(JavaThread *thread, Method* method,