< 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);

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::mark_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);
< prev index next >