< prev index next >

src/hotspot/share/classfile/classFileParser.cpp

Print this page

        

@@ -124,12 +124,11 @@
 #define JAVA_12_VERSION                   56
 
 #define JAVA_13_VERSION                   57
 
 void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
-  assert((bad_constant == JVM_CONSTANT_Module ||
-          bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,
+  assert((bad_constant == 19 || bad_constant == 20) && _major_version >= JAVA_9_VERSION,
          "Unexpected bad constant pool entry");
   if (_bad_constant_seen == 0) _bad_constant_seen = bad_constant;
 }
 
 void ClassFileParser::parse_constant_pool_entries(const ClassFileStream* const stream,

@@ -333,20 +332,21 @@
                                      cp,
                                      names_count,
                                      names,
                                      lengths,
                                      indices,
-                                     hashValues);
+                                     hashValues,
+                                     CHECK);
             names_count = 0;
           }
         } else {
           cp->symbol_at_put(index, result);
         }
         break;
       }
-      case JVM_CONSTANT_Module:
-      case JVM_CONSTANT_Package: {
+      case 19:
+      case 20: {
         // Record that an error occurred in these two cases but keep parsing so
         // that ACC_Module can be checked for in the access_flags.  Need to
         // throw NoClassDefFoundError in that case.
         if (_major_version >= JAVA_9_VERSION) {
           cfs->guarantee_more(3, CHECK);

@@ -370,11 +370,12 @@
                              cp,
                              names_count,
                              names,
                              lengths,
                              indices,
-                             hashValues);
+                             hashValues,
+                             CHECK);
   }
 
   // Copy _current pointer of local copy back to stream.
   assert(stream->current() == old_current, "non-exclusive use of stream");
   stream->set_current(cfs1.current());

@@ -819,11 +820,11 @@
         patch_class(cp, index, k, k->name());
       } else {
         guarantee_property(java_lang_String::is_instance(patch()),
                            "Illegal class patch at %d in class file %s",
                            index, CHECK);
-        Symbol* const name = java_lang_String::as_symbol(patch());
+        Symbol* const name = java_lang_String::as_symbol(patch(), CHECK);
         patch_class(cp, index, NULL, name);
       }
       break;
     }
 

@@ -5719,11 +5720,11 @@
 
     // Create a symbol and update the anonymous class name.
     // The new class name is created with a refcount of one. When installed into the InstanceKlass,
     // it'll be two and when the ClassFileParser destructor runs, it'll go back to one and get deleted
     // when the class is unloaded.
-    _class_name = SymbolTable::new_symbol(new_anon_name, symbol_len);
+    _class_name = SymbolTable::new_symbol(new_anon_name, symbol_len, CHECK);
   }
 }
 
 // If the host class and the anonymous class are in the same package then do
 // nothing.  If the anonymous class is in the unnamed package then move it to its

@@ -5972,13 +5973,13 @@
 
   // Version numbers
   _minor_version = stream->get_u2_fast();
   _major_version = stream->get_u2_fast();
 
-  if (DumpSharedSpaces && _major_version < JAVA_6_VERSION) {
+  if (DumpSharedSpaces && _major_version < JAVA_1_5_VERSION) {
     ResourceMark rm;
-    warning("Pre JDK 6 class not supported by CDS: %u.%u %s",
+    warning("Pre JDK 1.5 class not supported by CDS: %u.%u %s",
             _major_version,  _minor_version, _class_name->as_C_string());
     Exceptions::fthrow(
       THREAD_AND_LOCATION,
       vmSymbols::java_lang_UnsupportedClassVersionError(),
       "Unsupported major.minor version for dump time %u.%u",
< prev index next >