src/share/vm/interpreter/rewriter.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8171155 Sdiff src/share/vm/interpreter

src/share/vm/interpreter/rewriter.cpp

Print this page
rev 12406 : 1234567: Invalid bug number
Summary: This is a local commit to reduce jprt submit time.
Reviewed-by: kvn


 409         case Bytecodes::_putstatic      :
 410         case Bytecodes::_putfield       : {
 411           if (!reverse) {
 412             // Check if any final field of the class given as parameter is modified
 413             // outside of initializer methods of the class. Fields that are modified
 414             // are marked with a flag. For marked fields, the compilers do not perform
 415             // constant folding (as the field can be changed after initialization).
 416             //
 417             // The check is performed after verification and only if verification has
 418             // succeeded. Therefore, the class is guaranteed to be well-formed.
 419             InstanceKlass* klass = method->method_holder();
 420             u2 bc_index = Bytes::get_Java_u2(bcp + prefix_length + 1);
 421             constantPoolHandle cp(method->constants());
 422             Symbol* ref_class_name = cp->klass_name_at(cp->klass_ref_index_at(bc_index));
 423 
 424             if (klass->name() == ref_class_name) {
 425               Symbol* field_name = cp->name_ref_at(bc_index);
 426               Symbol* field_sig = cp->signature_ref_at(bc_index);
 427 
 428               fieldDescriptor fd;
 429               klass->find_field(field_name, field_sig, &fd);
 430               if (fd.access_flags().is_final()) {
 431                 if (fd.access_flags().is_static()) {
 432                   if (!method->is_static_initializer()) {
 433                     fd.set_has_initialized_final_update(true);
 434                   }
 435                 } else {
 436                   if (!method->is_object_initializer()) {
 437                     fd.set_has_initialized_final_update(true);

 438                   }
 439                 }
 440               }
 441             }
 442           }
 443         }
 444         // fall through
 445         case Bytecodes::_getstatic      : // fall through
 446         case Bytecodes::_getfield       : // fall through
 447         case Bytecodes::_invokevirtual  : // fall through
 448         case Bytecodes::_invokestatic   :
 449         case Bytecodes::_invokeinterface:
 450         case Bytecodes::_invokehandle   : // if reverse=true
 451           rewrite_member_reference(bcp, prefix_length+1, reverse);
 452           break;
 453         case Bytecodes::_invokedynamic:
 454           rewrite_invokedynamic(bcp, prefix_length+1, reverse);
 455           break;
 456         case Bytecodes::_ldc:
 457         case Bytecodes::_fast_aldc:  // if reverse=true




 409         case Bytecodes::_putstatic      :
 410         case Bytecodes::_putfield       : {
 411           if (!reverse) {
 412             // Check if any final field of the class given as parameter is modified
 413             // outside of initializer methods of the class. Fields that are modified
 414             // are marked with a flag. For marked fields, the compilers do not perform
 415             // constant folding (as the field can be changed after initialization).
 416             //
 417             // The check is performed after verification and only if verification has
 418             // succeeded. Therefore, the class is guaranteed to be well-formed.
 419             InstanceKlass* klass = method->method_holder();
 420             u2 bc_index = Bytes::get_Java_u2(bcp + prefix_length + 1);
 421             constantPoolHandle cp(method->constants());
 422             Symbol* ref_class_name = cp->klass_name_at(cp->klass_ref_index_at(bc_index));
 423 
 424             if (klass->name() == ref_class_name) {
 425               Symbol* field_name = cp->name_ref_at(bc_index);
 426               Symbol* field_sig = cp->signature_ref_at(bc_index);
 427 
 428               fieldDescriptor fd;
 429               if (klass->find_field(field_name, field_sig, &fd) != NULL) {
 430                 if (fd.access_flags().is_final()) {
 431                   if (fd.access_flags().is_static()) {
 432                     if (!method->is_static_initializer()) {
 433                       fd.set_has_initialized_final_update(true);
 434                     }
 435                   } else {
 436                     if (!method->is_object_initializer()) {
 437                       fd.set_has_initialized_final_update(true);
 438                     }
 439                   }
 440                 }
 441               }
 442             }
 443           }
 444         }
 445         // fall through
 446         case Bytecodes::_getstatic      : // fall through
 447         case Bytecodes::_getfield       : // fall through
 448         case Bytecodes::_invokevirtual  : // fall through
 449         case Bytecodes::_invokestatic   :
 450         case Bytecodes::_invokeinterface:
 451         case Bytecodes::_invokehandle   : // if reverse=true
 452           rewrite_member_reference(bcp, prefix_length+1, reverse);
 453           break;
 454         case Bytecodes::_invokedynamic:
 455           rewrite_invokedynamic(bcp, prefix_length+1, reverse);
 456           break;
 457         case Bytecodes::_ldc:
 458         case Bytecodes::_fast_aldc:  // if reverse=true


src/share/vm/interpreter/rewriter.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File