< prev index next >

src/share/vm/prims/jniCheck.cpp

Print this page
rev 12476 : 8171924: Use SIZE_FORMAT to print size_t values.
Reviewed-by: dholmes
Contributed-by: arno.zeller@sap.com


 221   }
 222   check_pending_exception(thr);
 223 }
 224 
 225 static inline void
 226 functionEnterExceptionAllowed(JavaThread* thr)
 227 {
 228   if (thr->in_critical()) {
 229     tty->print_cr("%s", warn_other_function_in_critical);
 230   }
 231 }
 232 
 233 static inline void
 234 functionExit(JavaThread* thr)
 235 {
 236   JNIHandleBlock* handles = thr->active_handles();
 237   size_t planned_capacity = handles->get_planned_capacity();
 238   size_t live_handles = handles->get_number_of_live_handles();
 239   if (live_handles > planned_capacity) {
 240     IN_VM(
 241       tty->print_cr("WARNING: JNI local refs: %zu, exceeds capacity: %zu",
 242           live_handles, planned_capacity);
 243       thr->print_stack();
 244     )
 245     // Complain just the once, reset to current + warn threshold
 246     add_planned_handle_capacity(handles, 0);
 247   }
 248 }
 249 
 250 static inline void
 251 checkStaticFieldID(JavaThread* thr, jfieldID fid, jclass cls, int ftype)
 252 {
 253   fieldDescriptor fd;
 254 
 255   /* make sure it is a static field */
 256   if (!jfieldIDWorkaround::is_static_jfieldID(fid))
 257     ReportJNIFatalError(thr, fatal_should_be_static);
 258 
 259   /* validate the class being passed */
 260   ASSERT_OOPS_ALLOWED;
 261   Klass* k_oop = jniCheck::validate_class(thr, cls, false);




 221   }
 222   check_pending_exception(thr);
 223 }
 224 
 225 static inline void
 226 functionEnterExceptionAllowed(JavaThread* thr)
 227 {
 228   if (thr->in_critical()) {
 229     tty->print_cr("%s", warn_other_function_in_critical);
 230   }
 231 }
 232 
 233 static inline void
 234 functionExit(JavaThread* thr)
 235 {
 236   JNIHandleBlock* handles = thr->active_handles();
 237   size_t planned_capacity = handles->get_planned_capacity();
 238   size_t live_handles = handles->get_number_of_live_handles();
 239   if (live_handles > planned_capacity) {
 240     IN_VM(
 241       tty->print_cr("WARNING: JNI local refs: " SIZE_FORMAT ", exceeds capacity: " SIZE_FORMAT,
 242                     live_handles, planned_capacity);
 243       thr->print_stack();
 244     )
 245     // Complain just the once, reset to current + warn threshold
 246     add_planned_handle_capacity(handles, 0);
 247   }
 248 }
 249 
 250 static inline void
 251 checkStaticFieldID(JavaThread* thr, jfieldID fid, jclass cls, int ftype)
 252 {
 253   fieldDescriptor fd;
 254 
 255   /* make sure it is a static field */
 256   if (!jfieldIDWorkaround::is_static_jfieldID(fid))
 257     ReportJNIFatalError(thr, fatal_should_be_static);
 258 
 259   /* validate the class being passed */
 260   ASSERT_OOPS_ALLOWED;
 261   Klass* k_oop = jniCheck::validate_class(thr, cls, false);


< prev index next >