< prev index next >

src/hotspot/share/prims/jvmtiExport.cpp

Print this page

2029       case T_SHORT:
2030         sig_type = JVM_SIGNATURE_SHORT;
2031         value->i = 0; // clear it
2032         value->s = (jshort)ival;
2033         break;
2034       case T_INT:
2035         // nothing to do
2036         break;
2037       default:
2038         // this is an integer instruction, should be one of above
2039         ShouldNotReachHere();
2040         break;
2041       }
2042     }
2043   }
2044 
2045   assert(sig_type != JVM_SIGNATURE_ARRAY, "array should have sig_type == 'L'");
2046   bool handle_created = false;
2047 
2048   // convert oop to JNI handle.
2049   if (sig_type == JVM_SIGNATURE_CLASS) {
2050     handle_created = true;
2051     value->l = (jobject)JNIHandles::make_local(thread, cast_to_oop(value->l));
2052   }
2053 
2054   post_field_modification(thread, method, location, field_klass, object, field, sig_type, value);
2055 
2056   // Destroy the JNI handle allocated above.
2057   if (handle_created) {
2058     JNIHandles::destroy_local(value->l);
2059   }
2060 }
2061 
2062 void JvmtiExport::post_field_modification(JavaThread *thread, Method* method,
2063   address location, Klass* field_klass, Handle object, jfieldID field,
2064   char sig_type, jvalue *value_ptr) {
2065 
2066   HandleMark hm(thread);
2067   methodHandle mh(thread, method);
2068 
2069   JvmtiThreadState *state = thread->jvmti_thread_state();

2029       case T_SHORT:
2030         sig_type = JVM_SIGNATURE_SHORT;
2031         value->i = 0; // clear it
2032         value->s = (jshort)ival;
2033         break;
2034       case T_INT:
2035         // nothing to do
2036         break;
2037       default:
2038         // this is an integer instruction, should be one of above
2039         ShouldNotReachHere();
2040         break;
2041       }
2042     }
2043   }
2044 
2045   assert(sig_type != JVM_SIGNATURE_ARRAY, "array should have sig_type == 'L'");
2046   bool handle_created = false;
2047 
2048   // convert oop to JNI handle.
2049   if (sig_type == JVM_SIGNATURE_CLASS || sig_type == JVM_SIGNATURE_INLINE_TYPE) {
2050     handle_created = true;
2051     value->l = (jobject)JNIHandles::make_local(thread, cast_to_oop(value->l));
2052   }
2053 
2054   post_field_modification(thread, method, location, field_klass, object, field, sig_type, value);
2055 
2056   // Destroy the JNI handle allocated above.
2057   if (handle_created) {
2058     JNIHandles::destroy_local(value->l);
2059   }
2060 }
2061 
2062 void JvmtiExport::post_field_modification(JavaThread *thread, Method* method,
2063   address location, Klass* field_klass, Handle object, jfieldID field,
2064   char sig_type, jvalue *value_ptr) {
2065 
2066   HandleMark hm(thread);
2067   methodHandle mh(thread, method);
2068 
2069   JvmtiThreadState *state = thread->jvmti_thread_state();
< prev index next >