< prev index next >

src/hotspot/share/prims/jvmtiExport.cpp

Print this page

1996       case T_SHORT:
1997         sig_type = JVM_SIGNATURE_SHORT;
1998         value->i = 0; // clear it
1999         value->s = (jshort)ival;
2000         break;
2001       case T_INT:
2002         // nothing to do
2003         break;
2004       default:
2005         // this is an integer instruction, should be one of above
2006         ShouldNotReachHere();
2007         break;
2008       }
2009     }
2010   }
2011 
2012   assert(sig_type != JVM_SIGNATURE_ARRAY, "array should have sig_type == 'L'");
2013   bool handle_created = false;
2014 
2015   // convert oop to JNI handle.
2016   if (sig_type == JVM_SIGNATURE_CLASS) {
2017     handle_created = true;
2018     value->l = (jobject)JNIHandles::make_local(thread, cast_to_oop(value->l));
2019   }
2020 
2021   post_field_modification(thread, method, location, field_klass, object, field, sig_type, value);
2022 
2023   // Destroy the JNI handle allocated above.
2024   if (handle_created) {
2025     JNIHandles::destroy_local(value->l);
2026   }
2027 }
2028 
2029 void JvmtiExport::post_field_modification(JavaThread *thread, Method* method,
2030   address location, Klass* field_klass, Handle object, jfieldID field,
2031   char sig_type, jvalue *value_ptr) {
2032 
2033   HandleMark hm(thread);
2034   methodHandle mh(thread, method);
2035 
2036   JvmtiThreadState *state = thread->jvmti_thread_state();

1996       case T_SHORT:
1997         sig_type = JVM_SIGNATURE_SHORT;
1998         value->i = 0; // clear it
1999         value->s = (jshort)ival;
2000         break;
2001       case T_INT:
2002         // nothing to do
2003         break;
2004       default:
2005         // this is an integer instruction, should be one of above
2006         ShouldNotReachHere();
2007         break;
2008       }
2009     }
2010   }
2011 
2012   assert(sig_type != JVM_SIGNATURE_ARRAY, "array should have sig_type == 'L'");
2013   bool handle_created = false;
2014 
2015   // convert oop to JNI handle.
2016   if (sig_type == JVM_SIGNATURE_CLASS || sig_type == JVM_SIGNATURE_PRIMITIVE_OBJECT) {
2017     handle_created = true;
2018     value->l = (jobject)JNIHandles::make_local(thread, cast_to_oop(value->l));
2019   }
2020 
2021   post_field_modification(thread, method, location, field_klass, object, field, sig_type, value);
2022 
2023   // Destroy the JNI handle allocated above.
2024   if (handle_created) {
2025     JNIHandles::destroy_local(value->l);
2026   }
2027 }
2028 
2029 void JvmtiExport::post_field_modification(JavaThread *thread, Method* method,
2030   address location, Klass* field_klass, Handle object, jfieldID field,
2031   char sig_type, jvalue *value_ptr) {
2032 
2033   HandleMark hm(thread);
2034   methodHandle mh(thread, method);
2035 
2036   JvmtiThreadState *state = thread->jvmti_thread_state();
< prev index next >