< prev index next >

src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp

Print this page

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

305     // The method is a member invoker used by direct method handles.
306     if (VerifyMethodHandles) {
307       // make sure the trailing argument really is a MemberName (caller responsibility)
308       verify_klass(_masm, member_reg, VM_CLASS_ID(java_lang_invoke_MemberName),
309                    "MemberName required for invokeVirtual etc.");
310     }
311 
312     Address member_clazz(    member_reg, NONZERO(java_lang_invoke_MemberName::clazz_offset()));
313     Address member_vmindex(  member_reg, NONZERO(java_lang_invoke_MemberName::vmindex_offset()));
314     Address member_vmtarget( member_reg, NONZERO(java_lang_invoke_MemberName::method_offset()));
315     Address vmtarget_method( rmethod, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset()));
316 
317     Register temp1_recv_klass = temp1;
318     if (iid != vmIntrinsics::_linkToStatic) {
319       __ verify_oop(receiver_reg);
320       if (iid == vmIntrinsics::_linkToSpecial) {
321         // Don't actually load the klass; just null-check the receiver.
322         __ null_check(receiver_reg);
323       } else {
324         // load receiver klass itself
325         __ null_check(receiver_reg, oopDesc::mark_offset_in_bytes());
326         __ load_klass(temp1_recv_klass, receiver_reg);
327         __ verify_klass_ptr(temp1_recv_klass);
328       }
329       BLOCK_COMMENT("check_receiver {");
330       // The receiver for the MemberName must be in receiver_reg.
331       // Check the receiver against the MemberName.clazz
332       if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
333         // Did not load it above...
334         __ load_klass(temp1_recv_klass, receiver_reg);
335         __ verify_klass_ptr(temp1_recv_klass);
336       }
337       if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
338         Label L_ok;
339         Register temp2_defc = temp2;
340         __ load_heap_oop(temp2_defc, member_clazz, temp3);
341         load_klass_from_Class(_masm, temp2_defc);
342         __ verify_klass_ptr(temp2_defc);
343         __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok);
344         // If we get here, the type check failed!
345         __ hlt(0);
< prev index next >