< prev index next >

src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp

Print this page

290     // The method is a member invoker used by direct method handles.
291     if (VerifyMethodHandles) {
292       // make sure the trailing argument really is a MemberName (caller responsibility)
293       verify_klass(_masm, member_reg, VM_CLASS_ID(java_lang_invoke_MemberName),
294                    "MemberName required for invokeVirtual etc.");
295     }
296 
297     Address member_clazz(    member_reg, NONZERO(java_lang_invoke_MemberName::clazz_offset()));
298     Address member_vmindex(  member_reg, NONZERO(java_lang_invoke_MemberName::vmindex_offset()));
299     Address member_vmtarget( member_reg, NONZERO(java_lang_invoke_MemberName::method_offset()));
300     Address vmtarget_method( rmethod, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset()));
301 
302     Register temp1_recv_klass = temp1;
303     if (iid != vmIntrinsics::_linkToStatic) {
304       __ verify_oop(receiver_reg);
305       if (iid == vmIntrinsics::_linkToSpecial) {
306         // Don't actually load the klass; just null-check the receiver.
307         __ null_check(receiver_reg);
308       } else {
309         // load receiver klass itself
310         __ null_check(receiver_reg, oopDesc::klass_offset_in_bytes());
311         __ load_klass(temp1_recv_klass, receiver_reg);
312         __ verify_klass_ptr(temp1_recv_klass);
313       }
314       BLOCK_COMMENT("check_receiver {");
315       // The receiver for the MemberName must be in receiver_reg.
316       // Check the receiver against the MemberName.clazz
317       if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
318         // Did not load it above...
319         __ load_klass(temp1_recv_klass, receiver_reg);
320         __ verify_klass_ptr(temp1_recv_klass);
321       }
322       if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
323         Label L_ok;
324         Register temp2_defc = temp2;
325         __ load_heap_oop(temp2_defc, member_clazz, temp3);
326         load_klass_from_Class(_masm, temp2_defc);
327         __ verify_klass_ptr(temp2_defc);
328         __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok);
329         // If we get here, the type check failed!
330         __ hlt(0);
331         // __ STOP("receiver class disagrees with MemberName.clazz");

290     // The method is a member invoker used by direct method handles.
291     if (VerifyMethodHandles) {
292       // make sure the trailing argument really is a MemberName (caller responsibility)
293       verify_klass(_masm, member_reg, VM_CLASS_ID(java_lang_invoke_MemberName),
294                    "MemberName required for invokeVirtual etc.");
295     }
296 
297     Address member_clazz(    member_reg, NONZERO(java_lang_invoke_MemberName::clazz_offset()));
298     Address member_vmindex(  member_reg, NONZERO(java_lang_invoke_MemberName::vmindex_offset()));
299     Address member_vmtarget( member_reg, NONZERO(java_lang_invoke_MemberName::method_offset()));
300     Address vmtarget_method( rmethod, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset()));
301 
302     Register temp1_recv_klass = temp1;
303     if (iid != vmIntrinsics::_linkToStatic) {
304       __ verify_oop(receiver_reg);
305       if (iid == vmIntrinsics::_linkToSpecial) {
306         // Don't actually load the klass; just null-check the receiver.
307         __ null_check(receiver_reg);
308       } else {
309         // load receiver klass itself
310         __ load_klass(temp1_recv_klass, receiver_reg, true);

311         __ verify_klass_ptr(temp1_recv_klass);
312       }
313       BLOCK_COMMENT("check_receiver {");
314       // The receiver for the MemberName must be in receiver_reg.
315       // Check the receiver against the MemberName.clazz
316       if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
317         // Did not load it above...
318         __ load_klass(temp1_recv_klass, receiver_reg);
319         __ verify_klass_ptr(temp1_recv_klass);
320       }
321       if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
322         Label L_ok;
323         Register temp2_defc = temp2;
324         __ load_heap_oop(temp2_defc, member_clazz, temp3);
325         load_klass_from_Class(_masm, temp2_defc);
326         __ verify_klass_ptr(temp2_defc);
327         __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok);
328         // If we get here, the type check failed!
329         __ hlt(0);
330         // __ STOP("receiver class disagrees with MemberName.clazz");
< prev index next >