src/share/vm/prims/jvmtiExport.cpp

changeset 5131
f49e0508a38a
parent 5095
0b7f78069732
child 5421
825e6cb66923
equal deleted inserted replaced
5104:513a5298c1dd 5131: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,

mercurial