src/share/vm/classfile/classFileParser.cpp

Print this page




 389       case JVM_CONSTANT_UnresolvedClass :         // fall-through
 390       case JVM_CONSTANT_UnresolvedClassInError:
 391         ShouldNotReachHere();     // Only JVM_CONSTANT_ClassIndex should be present
 392         break;
 393       case JVM_CONSTANT_ClassIndex :
 394         {
 395           int class_index = cp->klass_index_at(index);
 396           check_property(valid_symbol_at(class_index),
 397                  "Invalid constant pool index %u in class file %s",
 398                  class_index, CHECK_(nullHandle));
 399           cp->unresolved_klass_at_put(index, cp->symbol_at(class_index));
 400         }
 401         break;
 402       case JVM_CONSTANT_StringIndex :
 403         {
 404           int string_index = cp->string_index_at(index);
 405           check_property(valid_symbol_at(string_index),
 406                  "Invalid constant pool index %u in class file %s",
 407                  string_index, CHECK_(nullHandle));
 408           Symbol* sym = cp->symbol_at(string_index);





 409           cp->unresolved_string_at_put(index, sym);
 410         }
 411         break;
 412       case JVM_CONSTANT_MethodHandle :
 413         {
 414           int ref_index = cp->method_handle_index_at(index);
 415           check_property(
 416             valid_cp_range(ref_index, length),
 417               "Invalid constant pool index %u in class file %s",
 418               ref_index, CHECK_(nullHandle));
 419           constantTag tag = cp->tag_at(ref_index);
 420           int ref_kind  = cp->method_handle_ref_kind_at(index);
 421           switch (ref_kind) {
 422           case JVM_REF_getField:
 423           case JVM_REF_getStatic:
 424           case JVM_REF_putField:
 425           case JVM_REF_putStatic:
 426             check_property(
 427               tag.is_field(),
 428               "Invalid constant pool index %u in class file %s (not a field)",




 389       case JVM_CONSTANT_UnresolvedClass :         // fall-through
 390       case JVM_CONSTANT_UnresolvedClassInError:
 391         ShouldNotReachHere();     // Only JVM_CONSTANT_ClassIndex should be present
 392         break;
 393       case JVM_CONSTANT_ClassIndex :
 394         {
 395           int class_index = cp->klass_index_at(index);
 396           check_property(valid_symbol_at(class_index),
 397                  "Invalid constant pool index %u in class file %s",
 398                  class_index, CHECK_(nullHandle));
 399           cp->unresolved_klass_at_put(index, cp->symbol_at(class_index));
 400         }
 401         break;
 402       case JVM_CONSTANT_StringIndex :
 403         {
 404           int string_index = cp->string_index_at(index);
 405           check_property(valid_symbol_at(string_index),
 406                  "Invalid constant pool index %u in class file %s",
 407                  string_index, CHECK_(nullHandle));
 408           Symbol* sym = cp->symbol_at(string_index);
 409           const char* CPH = "CONSTANT_PLACEHOLDER_";
 410           if (sym != NULL && strncmp(sym->as_utf8(), CPH, strlen(CPH)) == 0) {
 411             // Save the Utf8 index of pseudo-string for JvmtiConstantPoolReconstituter
 412             cp->map_pseudo_string_indices((u2)index, (u2)string_index);
 413           }
 414           cp->unresolved_string_at_put(index, sym);
 415         }
 416         break;
 417       case JVM_CONSTANT_MethodHandle :
 418         {
 419           int ref_index = cp->method_handle_index_at(index);
 420           check_property(
 421             valid_cp_range(ref_index, length),
 422               "Invalid constant pool index %u in class file %s",
 423               ref_index, CHECK_(nullHandle));
 424           constantTag tag = cp->tag_at(ref_index);
 425           int ref_kind  = cp->method_handle_ref_kind_at(index);
 426           switch (ref_kind) {
 427           case JVM_REF_getField:
 428           case JVM_REF_getStatic:
 429           case JVM_REF_putField:
 430           case JVM_REF_putStatic:
 431             check_property(
 432               tag.is_field(),
 433               "Invalid constant pool index %u in class file %s (not a field)",