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

src/share/vm/interpreter/rewriter.cpp

Print this page




 389             bc.number_of_pairs() < BinarySwitchThreshold
 390             ? Bytecodes::_fast_linearswitch
 391             : Bytecodes::_fast_binaryswitch
 392           );
 393 #endif
 394           break;
 395         }
 396         case Bytecodes::_fast_linearswitch:
 397         case Bytecodes::_fast_binaryswitch: {
 398 #ifndef CC_INTERP
 399           (*bcp) = Bytecodes::_lookupswitch;
 400 #endif
 401           break;
 402         }
 403 
 404         case Bytecodes::_invokespecial  : {
 405           rewrite_invokespecial(bcp, prefix_length+1, reverse, invokespecial_error);
 406           break;
 407         }
 408 





































 409         case Bytecodes::_getstatic      : // fall through
 410         case Bytecodes::_putstatic      : // fall through
 411         case Bytecodes::_getfield       : // fall through
 412         case Bytecodes::_putfield       : // fall through
 413         case Bytecodes::_invokevirtual  : // fall through
 414         case Bytecodes::_invokestatic   :
 415         case Bytecodes::_invokeinterface:
 416         case Bytecodes::_invokehandle   : // if reverse=true
 417           rewrite_member_reference(bcp, prefix_length+1, reverse);
 418           break;
 419         case Bytecodes::_invokedynamic:
 420           rewrite_invokedynamic(bcp, prefix_length+1, reverse);
 421           break;
 422         case Bytecodes::_ldc:
 423         case Bytecodes::_fast_aldc:  // if reverse=true
 424           maybe_rewrite_ldc(bcp, prefix_length+1, false, reverse);
 425           break;
 426         case Bytecodes::_ldc_w:
 427         case Bytecodes::_fast_aldc_w:  // if reverse=true
 428           maybe_rewrite_ldc(bcp, prefix_length+1, true, reverse);
 429           break;
 430         case Bytecodes::_jsr            : // fall through
 431         case Bytecodes::_jsr_w          : nof_jsrs++;                   break;
 432         case Bytecodes::_monitorenter   : // fall through




 389             bc.number_of_pairs() < BinarySwitchThreshold
 390             ? Bytecodes::_fast_linearswitch
 391             : Bytecodes::_fast_binaryswitch
 392           );
 393 #endif
 394           break;
 395         }
 396         case Bytecodes::_fast_linearswitch:
 397         case Bytecodes::_fast_binaryswitch: {
 398 #ifndef CC_INTERP
 399           (*bcp) = Bytecodes::_lookupswitch;
 400 #endif
 401           break;
 402         }
 403 
 404         case Bytecodes::_invokespecial  : {
 405           rewrite_invokespecial(bcp, prefix_length+1, reverse, invokespecial_error);
 406           break;
 407         }
 408 
 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* field_name = cp->name_ref_at(bc_index);
 423             Symbol* field_sig = cp->signature_ref_at(bc_index);
 424             Symbol* ref_class_name = cp->klass_name_at(cp->klass_ref_index_at(bc_index));
 425 
 426             if (klass->name() == ref_class_name) {
 427               fieldDescriptor fd;
 428               klass->find_field(field_name, field_sig, &fd);
 429               if (fd.access_flags().is_final()) {
 430                 if (fd.access_flags().is_static()) {
 431                   assert(c == Bytecodes::_putstatic, "must be putstatic");
 432                   if (!method->is_static_initializer()) {
 433                     fd.set_has_initialized_final_update(true);
 434                   }
 435                 } else {
 436                   assert(c == Bytecodes::_putfield, "must be putfield");
 437                   if (!method->is_object_initializer()) {
 438                     fd.set_has_initialized_final_update(true);
 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
 459           maybe_rewrite_ldc(bcp, prefix_length+1, false, reverse);
 460           break;
 461         case Bytecodes::_ldc_w:
 462         case Bytecodes::_fast_aldc_w:  // if reverse=true
 463           maybe_rewrite_ldc(bcp, prefix_length+1, true, reverse);
 464           break;
 465         case Bytecodes::_jsr            : // fall through
 466         case Bytecodes::_jsr_w          : nof_jsrs++;                   break;
 467         case Bytecodes::_monitorenter   : // fall through


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