< prev index next >

src/hotspot/share/classfile/classFileParser.cpp

Print this page

        

@@ -4072,10 +4072,11 @@
   const bool has_nonstatic_value_fields = nonstatic_value_type_count > 0;
 
   if (is_value_type() && (!has_nonstatic_fields)) {
     // There are a number of fixes required throughout the type system and JIT
     throwValueTypeLimitation(THREAD_AND_LOCATION, "Value Types do not support zero instance size yet");
+    return;
   }
 
   // Prepare list of oops for oop map generation.
   //
   // "offset" and "count" lists are describing the set of contiguous oop

@@ -4529,11 +4530,11 @@
   info->static_field_size = static_field_size;
   info->nonstatic_field_size = nonstatic_field_size;
   info->has_nonstatic_fields = has_nonstatic_fields;
 }
 
-void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
+void ClassFileParser::set_precomputed_flags(InstanceKlass* ik, TRAPS) {
   assert(ik != NULL, "invariant");
 
   const Klass* const super = ik->super();
 
   // Check if this klass has an empty finalize method (i.e. one with return bytecode only),

@@ -4562,10 +4563,14 @@
 #endif
 
   // Check if this klass supports the java.lang.Cloneable interface
   if (SystemDictionary::Cloneable_klass_loaded()) {
     if (ik->is_subtype_of(SystemDictionary::Cloneable_klass())) {
+      if (ik->is_value()) {
+        throwValueTypeLimitation(THREAD_AND_LOCATION, "Value Types do not support Cloneable");
+        return;
+      }
       ik->set_is_cloneable();
     }
   }
 
   // Check if this klass has a vanilla default constructor

@@ -5738,11 +5743,11 @@
   if (oop_map_blocks->nonstatic_oop_map_count > 0) {
     oop_map_blocks->copy(ik->start_of_nonstatic_oop_maps());
   }
 
   // Fill in has_finalizer, has_vanilla_constructor, and layout_helper
-  set_precomputed_flags(ik);
+  set_precomputed_flags(ik, CHECK);
 
   // check if this class can access its super class
   check_super_class_access(ik, CHECK);
 
   // check if this class can access its superinterfaces
< prev index next >