2321 case T_SHORT:
2322 sig_type = JVM_SIGNATURE_SHORT;
2323 value->i = 0; // clear it
2324 value->s = (jshort)ival;
2325 break;
2326 case T_INT:
2327 // nothing to do
2328 break;
2329 default:
2330 // this is an integer instruction, should be one of above
2331 ShouldNotReachHere();
2332 break;
2333 }
2334 }
2335 }
2336
2337 assert(sig_type != JVM_SIGNATURE_ARRAY, "array should have sig_type == 'L'");
2338 bool handle_created = false;
2339
2340 // convert oop to JNI handle.
2341 if (sig_type == JVM_SIGNATURE_CLASS) {
2342 handle_created = true;
2343 value->l = (jobject)JNIHandles::make_local(thread, cast_to_oop(value->l));
2344 }
2345
2346 post_field_modification(thread, method, location, field_klass, object, field, sig_type, value);
2347
2348 // Destroy the JNI handle allocated above.
2349 if (handle_created) {
2350 JNIHandles::destroy_local(value->l);
2351 }
2352 }
2353
2354 void JvmtiExport::post_field_modification(JavaThread *thread, Method* method,
2355 address location, Klass* field_klass, Handle object, jfieldID field,
2356 char sig_type, jvalue *value_ptr) {
2357
2358 HandleMark hm(thread);
2359 methodHandle mh(thread, method);
2360
2361 JvmtiThreadState *state = thread->jvmti_thread_state();
|
2321 case T_SHORT:
2322 sig_type = JVM_SIGNATURE_SHORT;
2323 value->i = 0; // clear it
2324 value->s = (jshort)ival;
2325 break;
2326 case T_INT:
2327 // nothing to do
2328 break;
2329 default:
2330 // this is an integer instruction, should be one of above
2331 ShouldNotReachHere();
2332 break;
2333 }
2334 }
2335 }
2336
2337 assert(sig_type != JVM_SIGNATURE_ARRAY, "array should have sig_type == 'L'");
2338 bool handle_created = false;
2339
2340 // convert oop to JNI handle.
2341 if (sig_type == JVM_SIGNATURE_CLASS || sig_type == JVM_SIGNATURE_PRIMITIVE_OBJECT) {
2342 handle_created = true;
2343 value->l = (jobject)JNIHandles::make_local(thread, cast_to_oop(value->l));
2344 }
2345
2346 post_field_modification(thread, method, location, field_klass, object, field, sig_type, value);
2347
2348 // Destroy the JNI handle allocated above.
2349 if (handle_created) {
2350 JNIHandles::destroy_local(value->l);
2351 }
2352 }
2353
2354 void JvmtiExport::post_field_modification(JavaThread *thread, Method* method,
2355 address location, Klass* field_klass, Handle object, jfieldID field,
2356 char sig_type, jvalue *value_ptr) {
2357
2358 HandleMark hm(thread);
2359 methodHandle mh(thread, method);
2360
2361 JvmtiThreadState *state = thread->jvmti_thread_state();
|