< prev index next >

src/hotspot/share/prims/jvmtiExport.cpp

Print this page

2288       case T_SHORT:
2289         sig_type = JVM_SIGNATURE_SHORT;
2290         value->i = 0; // clear it
2291         value->s = (jshort)ival;
2292         break;
2293       case T_INT:
2294         // nothing to do
2295         break;
2296       default:
2297         // this is an integer instruction, should be one of above
2298         ShouldNotReachHere();
2299         break;
2300       }
2301     }
2302   }
2303 
2304   assert(sig_type != JVM_SIGNATURE_ARRAY, "array should have sig_type == 'L'");
2305   bool handle_created = false;
2306 
2307   // convert oop to JNI handle.
2308   if (sig_type == JVM_SIGNATURE_CLASS) {
2309     handle_created = true;
2310     value->l = (jobject)JNIHandles::make_local(thread, cast_to_oop(value->l));
2311   }
2312 
2313   post_field_modification(thread, method, location, field_klass, object, field, sig_type, value);
2314 
2315   // Destroy the JNI handle allocated above.
2316   if (handle_created) {
2317     JNIHandles::destroy_local(value->l);
2318   }
2319 }
2320 
2321 void JvmtiExport::post_field_modification(JavaThread *thread, Method* method,
2322   address location, Klass* field_klass, Handle object, jfieldID field,
2323   char sig_type, jvalue *value_ptr) {
2324 
2325   HandleMark hm(thread);
2326   methodHandle mh(thread, method);
2327 
2328   JvmtiThreadState *state = thread->jvmti_thread_state();

2288       case T_SHORT:
2289         sig_type = JVM_SIGNATURE_SHORT;
2290         value->i = 0; // clear it
2291         value->s = (jshort)ival;
2292         break;
2293       case T_INT:
2294         // nothing to do
2295         break;
2296       default:
2297         // this is an integer instruction, should be one of above
2298         ShouldNotReachHere();
2299         break;
2300       }
2301     }
2302   }
2303 
2304   assert(sig_type != JVM_SIGNATURE_ARRAY, "array should have sig_type == 'L'");
2305   bool handle_created = false;
2306 
2307   // convert oop to JNI handle.
2308   if (sig_type == JVM_SIGNATURE_CLASS || sig_type == JVM_SIGNATURE_PRIMITIVE_OBJECT) {
2309     handle_created = true;
2310     value->l = (jobject)JNIHandles::make_local(thread, cast_to_oop(value->l));
2311   }
2312 
2313   post_field_modification(thread, method, location, field_klass, object, field, sig_type, value);
2314 
2315   // Destroy the JNI handle allocated above.
2316   if (handle_created) {
2317     JNIHandles::destroy_local(value->l);
2318   }
2319 }
2320 
2321 void JvmtiExport::post_field_modification(JavaThread *thread, Method* method,
2322   address location, Klass* field_klass, Handle object, jfieldID field,
2323   char sig_type, jvalue *value_ptr) {
2324 
2325   HandleMark hm(thread);
2326   methodHandle mh(thread, method);
2327 
2328   JvmtiThreadState *state = thread->jvmti_thread_state();
< prev index next >