< prev index next >

src/hotspot/cpu/x86/methodHandles_x86.cpp

Print this page

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

347     // The method is a member invoker used by direct method handles.
348     if (VerifyMethodHandles) {
349       // make sure the trailing argument really is a MemberName (caller responsibility)
350       verify_klass(_masm, member_reg, VM_CLASS_ID(java_lang_invoke_MemberName),
351                    "MemberName required for invokeVirtual etc.");
352     }
353 
354     Address member_clazz(    member_reg, NONZERO(java_lang_invoke_MemberName::clazz_offset()));
355     Address member_vmindex(  member_reg, NONZERO(java_lang_invoke_MemberName::vmindex_offset()));
356     Address member_vmtarget( member_reg, NONZERO(java_lang_invoke_MemberName::method_offset()));
357     Address vmtarget_method( rbx_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset()));
358 
359     Register temp1_recv_klass = temp1;
360     if (iid != vmIntrinsics::_linkToStatic) {
361       __ verify_oop(receiver_reg);
362       if (iid == vmIntrinsics::_linkToSpecial) {
363         // Don't actually load the klass; just null-check the receiver.
364         __ null_check(receiver_reg);
365       } else {
366         // load receiver klass itself
367         __ load_klass(temp1_recv_klass, receiver_reg, temp2, true);

368         __ verify_klass_ptr(temp1_recv_klass);
369       }
370       BLOCK_COMMENT("check_receiver {");
371       // The receiver for the MemberName must be in receiver_reg.
372       // Check the receiver against the MemberName.clazz
373       if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
374         // Did not load it above...
375         __ load_klass(temp1_recv_klass, receiver_reg, temp2);
376         __ verify_klass_ptr(temp1_recv_klass);
377       }
378       if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
379         Label L_ok;
380         Register temp2_defc = temp2;
381         __ load_heap_oop(temp2_defc, member_clazz, temp3);
382         load_klass_from_Class(_masm, temp2_defc);
383         __ verify_klass_ptr(temp2_defc);
384         __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok);
385         // If we get here, the type check failed!
386         __ STOP("receiver class disagrees with MemberName.clazz");
387         __ bind(L_ok);
< prev index next >