< prev index next >

src/hotspot/share/prims/jvmtiImpl.cpp

Print this page




 656       signature_idx = (int) table[i].descriptor_cp_index;
 657       break;
 658     }
 659   }
 660   if (signature_idx == -1) {
 661     _result = JVMTI_ERROR_INVALID_SLOT;
 662     return false;       // Incorrect slot index
 663   }
 664   Symbol*   sign_sym  = method_oop->constants()->symbol_at(signature_idx);
 665   const char* signature = (const char *) sign_sym->as_utf8();
 666   BasicType slot_type = char2type(signature[0]);
 667 
 668   switch (slot_type) {
 669   case T_BYTE:
 670   case T_SHORT:
 671   case T_CHAR:
 672   case T_BOOLEAN:
 673     slot_type = T_INT;
 674     break;
 675   case T_ARRAY:

 676     slot_type = T_OBJECT;
 677     break;
 678   default:
 679     break;
 680   };
 681   if (_type != slot_type) {
 682     _result = JVMTI_ERROR_TYPE_MISMATCH;
 683     return false;
 684   }
 685 
 686   jobject jobj = _value.l;
 687   if (_set && slot_type == T_OBJECT && jobj != NULL) { // NULL reference is allowed
 688     // Check that the jobject class matches the return type signature.
 689     JavaThread* cur_thread = JavaThread::current();
 690     HandleMark hm(cur_thread);
 691 
 692     Handle obj(cur_thread, JNIHandles::resolve_external_guard(jobj));
 693     NULL_CHECK(obj, (_result = JVMTI_ERROR_INVALID_OBJECT, false));
 694     Klass* ob_k = obj->klass();
 695     NULL_CHECK(ob_k, (_result = JVMTI_ERROR_INVALID_OBJECT, false));




 656       signature_idx = (int) table[i].descriptor_cp_index;
 657       break;
 658     }
 659   }
 660   if (signature_idx == -1) {
 661     _result = JVMTI_ERROR_INVALID_SLOT;
 662     return false;       // Incorrect slot index
 663   }
 664   Symbol*   sign_sym  = method_oop->constants()->symbol_at(signature_idx);
 665   const char* signature = (const char *) sign_sym->as_utf8();
 666   BasicType slot_type = char2type(signature[0]);
 667 
 668   switch (slot_type) {
 669   case T_BYTE:
 670   case T_SHORT:
 671   case T_CHAR:
 672   case T_BOOLEAN:
 673     slot_type = T_INT;
 674     break;
 675   case T_ARRAY:
 676   case T_VALUETYPE:
 677     slot_type = T_OBJECT;
 678     break;
 679   default:
 680     break;
 681   };
 682   if (_type != slot_type) {
 683     _result = JVMTI_ERROR_TYPE_MISMATCH;
 684     return false;
 685   }
 686 
 687   jobject jobj = _value.l;
 688   if (_set && slot_type == T_OBJECT && jobj != NULL) { // NULL reference is allowed
 689     // Check that the jobject class matches the return type signature.
 690     JavaThread* cur_thread = JavaThread::current();
 691     HandleMark hm(cur_thread);
 692 
 693     Handle obj(cur_thread, JNIHandles::resolve_external_guard(jobj));
 694     NULL_CHECK(obj, (_result = JVMTI_ERROR_INVALID_OBJECT, false));
 695     Klass* ob_k = obj->klass();
 696     NULL_CHECK(ob_k, (_result = JVMTI_ERROR_INVALID_OBJECT, false));


< prev index next >