< prev index next >

src/hotspot/cpu/x86/methodHandles_x86.cpp

Print this page

362     // The method is a member invoker used by direct method handles.
363     if (VerifyMethodHandles) {
364       // make sure the trailing argument really is a MemberName (caller responsibility)
365       verify_klass(_masm, member_reg, VM_CLASS_ID(java_lang_invoke_MemberName),
366                    "MemberName required for invokeVirtual etc.");
367     }
368 
369     Address member_clazz(    member_reg, NONZERO(java_lang_invoke_MemberName::clazz_offset()));
370     Address member_vmindex(  member_reg, NONZERO(java_lang_invoke_MemberName::vmindex_offset()));
371     Address member_vmtarget( member_reg, NONZERO(java_lang_invoke_MemberName::method_offset()));
372     Address vmtarget_method( rbx_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset()));
373 
374     Register temp1_recv_klass = temp1;
375     if (iid != vmIntrinsics::_linkToStatic) {
376       __ verify_oop(receiver_reg);
377       if (iid == vmIntrinsics::_linkToSpecial) {
378         // Don't actually load the klass; just null-check the receiver.
379         __ null_check(receiver_reg);
380       } else {
381         // load receiver klass itself
382         __ null_check(receiver_reg, oopDesc::klass_offset_in_bytes());
383         __ load_klass(temp1_recv_klass, receiver_reg, temp2);
384         __ verify_klass_ptr(temp1_recv_klass);
385       }
386       BLOCK_COMMENT("check_receiver {");
387       // The receiver for the MemberName must be in receiver_reg.
388       // Check the receiver against the MemberName.clazz
389       if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
390         // Did not load it above...
391         __ load_klass(temp1_recv_klass, receiver_reg, temp2);
392         __ verify_klass_ptr(temp1_recv_klass);
393       }
394       if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
395         Label L_ok;
396         Register temp2_defc = temp2;
397         __ load_heap_oop(temp2_defc, member_clazz, temp3);
398         load_klass_from_Class(_masm, temp2_defc);
399         __ verify_klass_ptr(temp2_defc);
400         __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok);
401         // If we get here, the type check failed!
402         __ STOP("receiver class disagrees with MemberName.clazz");
403         __ bind(L_ok);

362     // The method is a member invoker used by direct method handles.
363     if (VerifyMethodHandles) {
364       // make sure the trailing argument really is a MemberName (caller responsibility)
365       verify_klass(_masm, member_reg, VM_CLASS_ID(java_lang_invoke_MemberName),
366                    "MemberName required for invokeVirtual etc.");
367     }
368 
369     Address member_clazz(    member_reg, NONZERO(java_lang_invoke_MemberName::clazz_offset()));
370     Address member_vmindex(  member_reg, NONZERO(java_lang_invoke_MemberName::vmindex_offset()));
371     Address member_vmtarget( member_reg, NONZERO(java_lang_invoke_MemberName::method_offset()));
372     Address vmtarget_method( rbx_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset()));
373 
374     Register temp1_recv_klass = temp1;
375     if (iid != vmIntrinsics::_linkToStatic) {
376       __ verify_oop(receiver_reg);
377       if (iid == vmIntrinsics::_linkToSpecial) {
378         // Don't actually load the klass; just null-check the receiver.
379         __ null_check(receiver_reg);
380       } else {
381         // load receiver klass itself
382         __ load_klass(temp1_recv_klass, receiver_reg, temp2, true);

383         __ verify_klass_ptr(temp1_recv_klass);
384       }
385       BLOCK_COMMENT("check_receiver {");
386       // The receiver for the MemberName must be in receiver_reg.
387       // Check the receiver against the MemberName.clazz
388       if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
389         // Did not load it above...
390         __ load_klass(temp1_recv_klass, receiver_reg, temp2);
391         __ verify_klass_ptr(temp1_recv_klass);
392       }
393       if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
394         Label L_ok;
395         Register temp2_defc = temp2;
396         __ load_heap_oop(temp2_defc, member_clazz, temp3);
397         load_klass_from_Class(_masm, temp2_defc);
398         __ verify_klass_ptr(temp2_defc);
399         __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok);
400         // If we get here, the type check failed!
401         __ STOP("receiver class disagrees with MemberName.clazz");
402         __ bind(L_ok);
< prev index next >