< prev index next >

src/hotspot/cpu/x86/methodHandles_x86.cpp

Print this page

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

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

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