< prev index next >

src/cpu/x86/vm/methodHandles_x86.cpp

Print this page

        

@@ -162,14 +162,17 @@
   assert(method_temp == rbx, "required register for loading method");
 
   //NOT_PRODUCT({ FlagSetting fs(TraceMethodHandles, true); trace_method_handle(_masm, "LZMH"); });
 
   // Load the invoker, as MH -> MH.form -> LF.vmentry
+  oopDesc::bs()->interpreter_read_barrier(_masm, recv);
   __ verify_oop(recv);
   __ load_heap_oop(method_temp, Address(recv, NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes())));
+  oopDesc::bs()->interpreter_read_barrier(_masm, method_temp);
   __ verify_oop(method_temp);
   __ load_heap_oop(method_temp, Address(method_temp, NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes())));
+  oopDesc::bs()->interpreter_read_barrier(_masm, method_temp);
   __ verify_oop(method_temp);
   // the following assumes that a Method* is normally compressed in the vmtarget field:
   __ movptr(method_temp, Address(method_temp, NONZERO(java_lang_invoke_MemberName::vmtarget_offset_in_bytes())));
 
   if (VerifyMethodHandles && !for_compiler_entry) {

@@ -177,14 +180,15 @@
     __ movptr(temp2, Address(method_temp, Method::const_offset()));
     __ load_sized_value(temp2,
                         Address(temp2, ConstMethod::size_of_parameters_offset()),
                         sizeof(u2), /*is_signed*/ false);
     // assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
+    __ movptr(temp2, __ argument_address(temp2, -1));
     Label L;
-    __ cmpptr(recv, __ argument_address(temp2, -1));
+    __ cmpoops(recv, temp2);
     __ jcc(Assembler::equal, L);
-    __ movptr(rax, __ argument_address(temp2, -1));
+    __ movptr(rax, temp2);
     __ STOP("receiver not on stack");
     __ BIND(L);
   }
 
   jump_from_method_handle(_masm, method_temp, temp2, for_compiler_entry);

@@ -373,10 +377,11 @@
     //  member_reg - MemberName that was the trailing argument
     //  temp1_recv_klass - klass of stacked receiver, if needed
     //  rsi/r13 - interpreter linkage (if interpreted)
     //  rcx, rdx, rsi, rdi, r8 - compiler arguments (if compiled)
 
+    oopDesc::bs()->interpreter_read_barrier(_masm, member_reg);
     Label L_incompatible_class_change_error;
     switch (iid) {
     case vmIntrinsics::_linkToSpecial:
       if (VerifyMethodHandles) {
         verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp3);
< prev index next >