comparison src/share/vm/prims/jni.cpp @ 6985:80e866b1d053

Merge
author coleenp
date Fri, 16 Nov 2012 09:19:12 -0500
parents bd7a7ce2e264 070d523b96a7
children 2cb439954abf 7c15faa95ce7 f34d701e952e
comparison
equal deleted inserted replaced
6974:6b6ddf8c4329 6985:80e866b1d053
232 232
233 233
234 intptr_t jfieldIDWorkaround::encode_klass_hash(Klass* k, intptr_t offset) { 234 intptr_t jfieldIDWorkaround::encode_klass_hash(Klass* k, intptr_t offset) {
235 if (offset <= small_offset_mask) { 235 if (offset <= small_offset_mask) {
236 Klass* field_klass = k; 236 Klass* field_klass = k;
237 Klass* super_klass = Klass::cast(field_klass)->super(); 237 Klass* super_klass = field_klass->super();
238 // With compressed oops the most super class with nonstatic fields would 238 // With compressed oops the most super class with nonstatic fields would
239 // be the owner of fields embedded in the header. 239 // be the owner of fields embedded in the header.
240 while (InstanceKlass::cast(super_klass)->has_nonstatic_fields() && 240 while (InstanceKlass::cast(super_klass)->has_nonstatic_fields() &&
241 InstanceKlass::cast(super_klass)->contains_field_offset(offset)) { 241 InstanceKlass::cast(super_klass)->contains_field_offset(offset)) {
242 field_klass = super_klass; // super contains the field also 242 field_klass = super_klass; // super contains the field also
243 super_klass = Klass::cast(field_klass)->super(); 243 super_klass = field_klass->super();
244 } 244 }
245 debug_only(No_Safepoint_Verifier nosafepoint;) 245 debug_only(No_Safepoint_Verifier nosafepoint;)
246 uintptr_t klass_hash = field_klass->identity_hash(); 246 uintptr_t klass_hash = field_klass->identity_hash();
247 return ((klass_hash & klass_mask) << klass_shift) | checked_mask_in_place; 247 return ((klass_hash & klass_mask) << klass_shift) | checked_mask_in_place;
248 } else { 248 } else {
249 #if 0 249 #if 0
250 #ifndef PRODUCT 250 #ifndef PRODUCT
251 { 251 {
252 ResourceMark rm; 252 ResourceMark rm;
253 warning("VerifyJNIFields: long offset %d in %s", offset, Klass::cast(k)->external_name()); 253 warning("VerifyJNIFields: long offset %d in %s", offset, k->external_name());
254 } 254 }
255 #endif 255 #endif
256 #endif 256 #endif
257 return 0; 257 return 0;
258 } 258 }
264 do { 264 do {
265 debug_only(No_Safepoint_Verifier nosafepoint;) 265 debug_only(No_Safepoint_Verifier nosafepoint;)
266 // Could use a non-blocking query for identity_hash here... 266 // Could use a non-blocking query for identity_hash here...
267 if ((k->identity_hash() & klass_mask) == klass_hash) 267 if ((k->identity_hash() & klass_mask) == klass_hash)
268 return true; 268 return true;
269 k = Klass::cast(k)->super(); 269 k = k->super();
270 } while (k != NULL); 270 } while (k != NULL);
271 return false; 271 return false;
272 } 272 }
273 273
274 void jfieldIDWorkaround::verify_instance_jfieldID(Klass* k, jfieldID id) { 274 void jfieldIDWorkaround::verify_instance_jfieldID(Klass* k, jfieldID id) {
282 } else { 282 } else {
283 #if 0 283 #if 0
284 #ifndef PRODUCT 284 #ifndef PRODUCT
285 if (Verbose) { 285 if (Verbose) {
286 ResourceMark rm; 286 ResourceMark rm;
287 warning("VerifyJNIFields: unverified offset %d for %s", offset, Klass::cast(k)->external_name()); 287 warning("VerifyJNIFields: unverified offset %d for %s", offset, k->external_name());
288 } 288 }
289 #endif 289 #endif
290 #endif 290 #endif
291 } 291 }
292 } 292 }
414 if (TraceClassResolution && k != NULL) { 414 if (TraceClassResolution && k != NULL) {
415 trace_class_resolution(k); 415 trace_class_resolution(k);
416 } 416 }
417 417
418 cls = (jclass)JNIHandles::make_local( 418 cls = (jclass)JNIHandles::make_local(
419 env, Klass::cast(k)->java_mirror()); 419 env, k->java_mirror());
420 return cls; 420 return cls;
421 JNI_END 421 JNI_END
422 422
423 423
424 424
535 } 535 }
536 Klass* k = java_lang_Class::as_Klass(mirror); 536 Klass* k = java_lang_Class::as_Klass(mirror);
537 537
538 KlassHandle k1(THREAD, k); 538 KlassHandle k1(THREAD, k);
539 // Make sure class is initialized before handing id's out to methods 539 // Make sure class is initialized before handing id's out to methods
540 Klass::cast(k1())->initialize(CHECK_NULL); 540 k1()->initialize(CHECK_NULL);
541 Method* m = InstanceKlass::cast(k1())->method_with_idnum(slot); 541 Method* m = InstanceKlass::cast(k1())->method_with_idnum(slot);
542 ret = m==NULL? NULL : m->jmethod_id(); // return NULL if reflected method deleted 542 ret = m==NULL? NULL : m->jmethod_id(); // return NULL if reflected method deleted
543 return ret; 543 return ret;
544 JNI_END 544 JNI_END
545 545
568 int slot = java_lang_reflect_Field::slot(reflected); 568 int slot = java_lang_reflect_Field::slot(reflected);
569 int modifiers = java_lang_reflect_Field::modifiers(reflected); 569 int modifiers = java_lang_reflect_Field::modifiers(reflected);
570 570
571 KlassHandle k1(THREAD, k); 571 KlassHandle k1(THREAD, k);
572 // Make sure class is initialized before handing id's out to fields 572 // Make sure class is initialized before handing id's out to fields
573 Klass::cast(k1())->initialize(CHECK_NULL); 573 k1()->initialize(CHECK_NULL);
574 574
575 // First check if this is a static field 575 // First check if this is a static field
576 if (modifiers & JVM_ACC_STATIC) { 576 if (modifiers & JVM_ACC_STATIC) {
577 intptr_t offset = InstanceKlass::cast(k1())->field_offset( slot ); 577 intptr_t offset = InstanceKlass::cast(k1())->field_offset( slot );
578 JNIid* id = InstanceKlass::cast(k1())->jni_id_for(offset); 578 JNIid* id = InstanceKlass::cast(k1())->jni_id_for(offset);
647 // Rules of Class.getSuperClass as implemented by KLass::java_super: 647 // Rules of Class.getSuperClass as implemented by KLass::java_super:
648 // arrays return Object 648 // arrays return Object
649 // interfaces return NULL 649 // interfaces return NULL
650 // proper classes return Klass::super() 650 // proper classes return Klass::super()
651 Klass* k = java_lang_Class::as_Klass(mirror); 651 Klass* k = java_lang_Class::as_Klass(mirror);
652 if (Klass::cast(k)->is_interface()) return NULL; 652 if (k->is_interface()) return NULL;
653 653
654 // return mirror for superclass 654 // return mirror for superclass
655 Klass* super = Klass::cast(k)->java_super(); 655 Klass* super = k->java_super();
656 // super2 is the value computed by the compiler's getSuperClass intrinsic: 656 // super2 is the value computed by the compiler's getSuperClass intrinsic:
657 debug_only(Klass* super2 = ( Klass::cast(k)->oop_is_array() 657 debug_only(Klass* super2 = ( k->oop_is_array()
658 ? SystemDictionary::Object_klass() 658 ? SystemDictionary::Object_klass()
659 : Klass::cast(k)->super() ) ); 659 : k->super() ) );
660 assert(super == super2, 660 assert(super == super2,
661 "java_super computation depends on interface, array, other super"); 661 "java_super computation depends on interface, array, other super");
662 obj = (super == NULL) ? NULL : (jclass) JNIHandles::make_local(Klass::cast(super)->java_mirror()); 662 obj = (super == NULL) ? NULL : (jclass) JNIHandles::make_local(super->java_mirror());
663 return obj; 663 return obj;
664 JNI_END 664 JNI_END
665 665
666 JNI_QUICK_ENTRY(jboolean, jni_IsAssignableFrom(JNIEnv *env, jclass sub, jclass super)) 666 JNI_QUICK_ENTRY(jboolean, jni_IsAssignableFrom(JNIEnv *env, jclass sub, jclass super))
667 JNIWrapper("IsSubclassOf"); 667 JNIWrapper("IsSubclassOf");
685 return ret; 685 return ret;
686 } 686 }
687 Klass* sub_klass = java_lang_Class::as_Klass(sub_mirror); 687 Klass* sub_klass = java_lang_Class::as_Klass(sub_mirror);
688 Klass* super_klass = java_lang_Class::as_Klass(super_mirror); 688 Klass* super_klass = java_lang_Class::as_Klass(super_mirror);
689 assert(sub_klass != NULL && super_klass != NULL, "invalid arguments to jni_IsAssignableFrom"); 689 assert(sub_klass != NULL && super_klass != NULL, "invalid arguments to jni_IsAssignableFrom");
690 jboolean ret = Klass::cast(sub_klass)->is_subtype_of(super_klass) ? 690 jboolean ret = sub_klass->is_subtype_of(super_klass) ?
691 JNI_TRUE : JNI_FALSE; 691 JNI_TRUE : JNI_FALSE;
692 #ifndef USDT2 692 #ifndef USDT2
693 DTRACE_PROBE1(hotspot_jni, IsAssignableFrom__return, ret); 693 DTRACE_PROBE1(hotspot_jni, IsAssignableFrom__return, ret);
694 #else /* USDT2 */ 694 #else /* USDT2 */
695 HOTSPOT_JNI_ISASSIGNABLEFROM_RETURN( 695 HOTSPOT_JNI_ISASSIGNABLEFROM_RETURN(
819 CLEAR_PENDING_EXCEPTION; 819 CLEAR_PENDING_EXCEPTION;
820 } else { 820 } else {
821 ResourceMark rm(THREAD); 821 ResourceMark rm(THREAD);
822 jio_fprintf(defaultStream::error_stream(), 822 jio_fprintf(defaultStream::error_stream(),
823 ". Uncaught exception of type %s.", 823 ". Uncaught exception of type %s.",
824 Klass::cast(ex->klass())->external_name()); 824 ex->klass()->external_name());
825 } 825 }
826 } 826 }
827 } 827 }
828 #ifndef USDT2 828 #ifndef USDT2
829 DTRACE_PROBE(hotspot_jni, ExceptionDescribe__return); 829 DTRACE_PROBE(hotspot_jni, ExceptionDescribe__return);
1357 Method* selected_method; 1357 Method* selected_method;
1358 { 1358 {
1359 Method* m = Method::resolve_jmethod_id(method_id); 1359 Method* m = Method::resolve_jmethod_id(method_id);
1360 number_of_parameters = m->size_of_parameters(); 1360 number_of_parameters = m->size_of_parameters();
1361 Klass* holder = m->method_holder(); 1361 Klass* holder = m->method_holder();
1362 if (!(Klass::cast(holder))->is_interface()) { 1362 if (!(holder)->is_interface()) {
1363 // non-interface call -- for that little speed boost, don't handlize 1363 // non-interface call -- for that little speed boost, don't handlize
1364 debug_only(No_Safepoint_Verifier nosafepoint;) 1364 debug_only(No_Safepoint_Verifier nosafepoint;)
1365 if (call_type == JNI_VIRTUAL) { 1365 if (call_type == JNI_VIRTUAL) {
1366 // jni_GetMethodID makes sure class is linked and initialized 1366 // jni_GetMethodID makes sure class is linked and initialized
1367 // so m should have a valid vtable index. 1367 // so m should have a valid vtable index.
1422 } 1422 }
1423 1423
1424 1424
1425 static instanceOop alloc_object(jclass clazz, TRAPS) { 1425 static instanceOop alloc_object(jclass clazz, TRAPS) {
1426 KlassHandle k(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz))); 1426 KlassHandle k(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
1427 Klass::cast(k())->check_valid_for_instantiation(false, CHECK_NULL); 1427 k()->check_valid_for_instantiation(false, CHECK_NULL);
1428 InstanceKlass::cast(k())->initialize(CHECK_NULL); 1428 InstanceKlass::cast(k())->initialize(CHECK_NULL);
1429 instanceOop ih = InstanceKlass::cast(k())->allocate_instance(THREAD); 1429 instanceOop ih = InstanceKlass::cast(k())->allocate_instance(THREAD);
1430 return ih; 1430 return ih;
1431 } 1431 }
1432 1432
1544 HOTSPOT_JNI_GETOBJECTCLASS_ENTRY( 1544 HOTSPOT_JNI_GETOBJECTCLASS_ENTRY(
1545 env, obj); 1545 env, obj);
1546 #endif /* USDT2 */ 1546 #endif /* USDT2 */
1547 Klass* k = JNIHandles::resolve_non_null(obj)->klass(); 1547 Klass* k = JNIHandles::resolve_non_null(obj)->klass();
1548 jclass ret = 1548 jclass ret =
1549 (jclass) JNIHandles::make_local(env, Klass::cast(k)->java_mirror()); 1549 (jclass) JNIHandles::make_local(env, k->java_mirror());
1550 #ifndef USDT2 1550 #ifndef USDT2
1551 DTRACE_PROBE1(hotspot_jni, GetObjectClass__return, ret); 1551 DTRACE_PROBE1(hotspot_jni, GetObjectClass__return, ret);
1552 #else /* USDT2 */ 1552 #else /* USDT2 */
1553 HOTSPOT_JNI_GETOBJECTCLASS_RETURN( 1553 HOTSPOT_JNI_GETOBJECTCLASS_RETURN(
1554 ret); 1554 ret);
1609 KlassHandle klass(THREAD, 1609 KlassHandle klass(THREAD,
1610 java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz))); 1610 java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
1611 1611
1612 // Make sure class is linked and initialized before handing id's out to 1612 // Make sure class is linked and initialized before handing id's out to
1613 // Method*s. 1613 // Method*s.
1614 Klass::cast(klass())->initialize(CHECK_NULL); 1614 klass()->initialize(CHECK_NULL);
1615 1615
1616 Method* m; 1616 Method* m;
1617 if (name == vmSymbols::object_initializer_name() || 1617 if (name == vmSymbols::object_initializer_name() ||
1618 name == vmSymbols::class_initializer_name()) { 1618 name == vmSymbols::class_initializer_name()) {
1619 // Never search superclasses for constructors 1619 // Never search superclasses for constructors
2425 \ 2425 \
2426 JavaValue jvalue(Tag); \ 2426 JavaValue jvalue(Tag); \
2427 JNI_ArgumentPusherVaArg ap(methodID, args); \ 2427 JNI_ArgumentPusherVaArg ap(methodID, args); \
2428 /* Make sure class is initialized before trying to invoke its method */ \ 2428 /* Make sure class is initialized before trying to invoke its method */ \
2429 KlassHandle k(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls))); \ 2429 KlassHandle k(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls))); \
2430 Klass::cast(k())->initialize(CHECK_0); \ 2430 k()->initialize(CHECK_0); \
2431 jni_invoke_static(env, &jvalue, NULL, JNI_STATIC, methodID, &ap, CHECK_0); \ 2431 jni_invoke_static(env, &jvalue, NULL, JNI_STATIC, methodID, &ap, CHECK_0); \
2432 va_end(args); \ 2432 va_end(args); \
2433 ret = jvalue.get_##ResultType(); \ 2433 ret = jvalue.get_##ResultType(); \
2434 return ret;\ 2434 return ret;\
2435 JNI_END 2435 JNI_END
2610 THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name); 2610 THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name);
2611 } 2611 }
2612 KlassHandle k(THREAD, 2612 KlassHandle k(THREAD,
2613 java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz))); 2613 java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
2614 // Make sure class is initialized before handing id's out to fields 2614 // Make sure class is initialized before handing id's out to fields
2615 Klass::cast(k())->initialize(CHECK_NULL); 2615 k()->initialize(CHECK_NULL);
2616 2616
2617 fieldDescriptor fd; 2617 fieldDescriptor fd;
2618 if (!Klass::cast(k())->oop_is_instance() || 2618 if (!k()->oop_is_instance() ||
2619 !InstanceKlass::cast(k())->find_field(fieldname, signame, false, &fd)) { 2619 !InstanceKlass::cast(k())->find_field(fieldname, signame, false, &fd)) {
2620 THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name); 2620 THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name);
2621 } 2621 }
2622 2622
2623 // A jfieldID for a non-static field is simply the offset of the field within the instanceOop 2623 // A jfieldID for a non-static field is simply the offset of the field within the instanceOop
2975 THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name); 2975 THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name);
2976 } 2976 }
2977 KlassHandle k(THREAD, 2977 KlassHandle k(THREAD,
2978 java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz))); 2978 java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)));
2979 // Make sure class is initialized before handing id's out to static fields 2979 // Make sure class is initialized before handing id's out to static fields
2980 Klass::cast(k())->initialize(CHECK_NULL); 2980 k()->initialize(CHECK_NULL);
2981 2981
2982 fieldDescriptor fd; 2982 fieldDescriptor fd;
2983 if (!Klass::cast(k())->oop_is_instance() || 2983 if (!k()->oop_is_instance() ||
2984 !InstanceKlass::cast(k())->find_field(fieldname, signame, true, &fd)) { 2984 !InstanceKlass::cast(k())->find_field(fieldname, signame, true, &fd)) {
2985 THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name); 2985 THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name);
2986 } 2986 }
2987 2987
2988 // A jfieldID for a static field is a JNIid specifying the field holder and the offset within the Klass* 2988 // A jfieldID for a static field is a JNIid specifying the field holder and the offset within the Klass*
3438 env, length, elementClass, initialElement); 3438 env, length, elementClass, initialElement);
3439 #endif /* USDT2 */ 3439 #endif /* USDT2 */
3440 jobjectArray ret = NULL; 3440 jobjectArray ret = NULL;
3441 DT_RETURN_MARK(NewObjectArray, jobjectArray, (const jobjectArray&)ret); 3441 DT_RETURN_MARK(NewObjectArray, jobjectArray, (const jobjectArray&)ret);
3442 KlassHandle ek(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(elementClass))); 3442 KlassHandle ek(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(elementClass)));
3443 Klass* ako = Klass::cast(ek())->array_klass(CHECK_NULL); 3443 Klass* ako = ek()->array_klass(CHECK_NULL);
3444 KlassHandle ak = KlassHandle(THREAD, ako); 3444 KlassHandle ak = KlassHandle(THREAD, ako);
3445 ObjArrayKlass::cast(ak())->initialize(CHECK_NULL); 3445 ObjArrayKlass::cast(ak())->initialize(CHECK_NULL);
3446 objArrayOop result = ObjArrayKlass::cast(ak())->allocate(length, CHECK_NULL); 3446 objArrayOop result = ObjArrayKlass::cast(ak())->allocate(length, CHECK_NULL);
3447 oop initial_value = JNIHandles::resolve(initialElement); 3447 oop initial_value = JNIHandles::resolve(initialElement);
3448 if (initial_value != NULL) { // array already initialized with NULL 3448 if (initial_value != NULL) { // array already initialized with NULL
3969 strcat(trial_name_str, name_str); 3969 strcat(trial_name_str, name_str);
3970 TempNewSymbol trial_name = SymbolTable::probe(trial_name_str, trial_len); 3970 TempNewSymbol trial_name = SymbolTable::probe(trial_name_str, trial_len);
3971 if (trial_name == NULL) { 3971 if (trial_name == NULL) {
3972 continue; // no such symbol, so this prefix wasn't used, try the next prefix 3972 continue; // no such symbol, so this prefix wasn't used, try the next prefix
3973 } 3973 }
3974 method = Klass::cast(k())->lookup_method(trial_name, signature); 3974 method = k()->lookup_method(trial_name, signature);
3975 if (method == NULL) { 3975 if (method == NULL) {
3976 continue; // signature doesn't match, try the next prefix 3976 continue; // signature doesn't match, try the next prefix
3977 } 3977 }
3978 if (method->is_native()) { 3978 if (method->is_native()) {
3979 method->set_is_prefixed_native(); 3979 method->set_is_prefixed_native();
3986 #endif // INCLUDE_JVMTI 3986 #endif // INCLUDE_JVMTI
3987 return NULL; // not found 3987 return NULL; // not found
3988 } 3988 }
3989 3989
3990 static bool register_native(KlassHandle k, Symbol* name, Symbol* signature, address entry, TRAPS) { 3990 static bool register_native(KlassHandle k, Symbol* name, Symbol* signature, address entry, TRAPS) {
3991 Method* method = Klass::cast(k())->lookup_method(name, signature); 3991 Method* method = k()->lookup_method(name, signature);
3992 if (method == NULL) { 3992 if (method == NULL) {
3993 ResourceMark rm; 3993 ResourceMark rm;
3994 stringStream st; 3994 stringStream st;
3995 st.print("Method %s name or signature does not match", 3995 st.print("Method %s name or signature does not match",
3996 Method::name_and_sig_as_C_string(Klass::cast(k()), name, signature)); 3996 Method::name_and_sig_as_C_string(k(), name, signature));
3997 THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), false); 3997 THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), false);
3998 } 3998 }
3999 if (!method->is_native()) { 3999 if (!method->is_native()) {
4000 // trying to register to a non-native method, see if a JVM TI agent has added prefix(es) 4000 // trying to register to a non-native method, see if a JVM TI agent has added prefix(es)
4001 method = find_prefixed_native(k, name, signature, THREAD); 4001 method = find_prefixed_native(k, name, signature, THREAD);
4002 if (method == NULL) { 4002 if (method == NULL) {
4003 ResourceMark rm; 4003 ResourceMark rm;
4004 stringStream st; 4004 stringStream st;
4005 st.print("Method %s is not declared as native", 4005 st.print("Method %s is not declared as native",
4006 Method::name_and_sig_as_C_string(Klass::cast(k()), name, signature)); 4006 Method::name_and_sig_as_C_string(k(), name, signature));
4007 THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), false); 4007 THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), false);
4008 } 4008 }
4009 } 4009 }
4010 4010
4011 if (entry != NULL) { 4011 if (entry != NULL) {
4057 TempNewSymbol signature = SymbolTable::probe(meth_sig, (int)strlen(meth_sig)); 4057 TempNewSymbol signature = SymbolTable::probe(meth_sig, (int)strlen(meth_sig));
4058 4058
4059 if (name == NULL || signature == NULL) { 4059 if (name == NULL || signature == NULL) {
4060 ResourceMark rm; 4060 ResourceMark rm;
4061 stringStream st; 4061 stringStream st;
4062 st.print("Method %s.%s%s not found", Klass::cast(h_k())->external_name(), meth_name, meth_sig); 4062 st.print("Method %s.%s%s not found", h_k()->external_name(), meth_name, meth_sig);
4063 // Must return negative value on failure 4063 // Must return negative value on failure
4064 THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), -1); 4064 THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), st.as_string(), -1);
4065 } 4065 }
4066 4066
4067 bool res = register_native(h_k, name, signature, 4067 bool res = register_native(h_k, name, signature,
4083 HOTSPOT_JNI_UNREGISTERNATIVES_ENTRY( 4083 HOTSPOT_JNI_UNREGISTERNATIVES_ENTRY(
4084 env, clazz); 4084 env, clazz);
4085 #endif /* USDT2 */ 4085 #endif /* USDT2 */
4086 Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)); 4086 Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz));
4087 //%note jni_2 4087 //%note jni_2
4088 if (Klass::cast(k)->oop_is_instance()) { 4088 if (k->oop_is_instance()) {
4089 for (int index = 0; index < InstanceKlass::cast(k)->methods()->length(); index++) { 4089 for (int index = 0; index < InstanceKlass::cast(k)->methods()->length(); index++) {
4090 Method* m = InstanceKlass::cast(k)->methods()->at(index); 4090 Method* m = InstanceKlass::cast(k)->methods()->at(index);
4091 if (m->is_native()) { 4091 if (m->is_native()) {
4092 m->clear_native_function(); 4092 m->clear_native_function();
4093 m->set_signature_handler(NULL); 4093 m->set_signature_handler(NULL);