< prev index next >

src/hotspot/share/interpreter/rewriter.cpp

Print this page

        

@@ -167,11 +167,11 @@
 
 // Rewrite a classfile-order CP index into a native-order CPC index.
 void Rewriter::rewrite_member_reference(address bcp, int offset, bool reverse) {
   address p = bcp + offset;
   if (!reverse) {
-    int  cp_index    = Bytes::get_Java_u2(p);
+    int cp_index    = Bytes::get_Java_u2(p);
     int  cache_index = cp_entry_to_cp_cache(cp_index);
     Bytes::put_native_u2(p, cache_index);
     if (!_method_handle_invokers.is_empty())
       maybe_rewrite_invokehandle(p - 1, cp_index, cache_index, reverse);
   } else {

@@ -203,11 +203,10 @@
   } else {
     rewrite_member_reference(bcp, offset, reverse);
   }
 }
 
-
 // Adjust the invocation bytecode for a signature-polymorphic method (MethodHandle.invoke, etc.)
 void Rewriter::maybe_rewrite_invokehandle(address opc, int cp_index, int cache_index, bool reverse) {
   if (!reverse) {
     if ((*opc) == (u1)Bytecodes::_invokevirtual ||
         // allow invokespecial as an alias, although it would be very odd:

@@ -448,15 +447,15 @@
 
             fieldDescriptor fd;
             if (klass->find_field(field_name, field_sig, &fd) != NULL) {
               if (fd.access_flags().is_final()) {
                 if (fd.access_flags().is_static()) {
-                  if (!method->is_static_initializer()) {
+                  if (!method->is_class_initializer()) {
                     fd.set_has_initialized_final_update(true);
                   }
                 } else {
-                  if (!method->is_object_initializer()) {
+                  if (!method->is_object_constructor()) {
                     fd.set_has_initialized_final_update(true);
                   }
                 }
               }
             }

@@ -464,10 +463,11 @@
         }
       }
       // fall through
       case Bytecodes::_getstatic      : // fall through
       case Bytecodes::_getfield       : // fall through
+      case Bytecodes::_withfield     : // fall through but may require more checks for correctness
       case Bytecodes::_invokevirtual  : // fall through
       case Bytecodes::_invokestatic   :
       case Bytecodes::_invokeinterface:
       case Bytecodes::_invokehandle   : // if reverse=true
         rewrite_member_reference(bcp, prefix_length+1, reverse);
< prev index next >