< prev index next >

src/share/vm/ci/ciValueKlass.cpp

Print this page

        

@@ -34,16 +34,18 @@
   if (_field_index_map != NULL) {
     return _field_index_map->length();
   }
 
   Arena* arena = CURRENT_ENV->arena();
-  guarantee(has_nonstatic_fields(), "value types without fields currently not supported");
+  _field_index_map = new (arena) GrowableArray<int>(arena, nof_declared_nonstatic_fields(), 0, 0);
+  if (!has_nonstatic_fields()) {
+    return 0;
+  }
 
   // FIXME: Once it is possible to construct class hierarchies with value types.
   assert(!super()->has_nonstatic_fields(), "a value type must not inherit fields from its superclass");
 
-  _field_index_map = new (arena) GrowableArray<int>(arena, nof_declared_nonstatic_fields(), 0, 0);
   ValueKlass* vklass = ValueKlass::cast(get_Klass());
   for (JavaFieldStream fs(vklass); !fs.done(); fs.next()) {
     if (fs.access_flags().is_static()) {
       continue;
     }

@@ -52,13 +54,10 @@
   return _field_index_map->length();
 }
 
 // Number of value type fields
 int ciValueKlass::field_count() {
-  if (this == ciEnv::current()->___Value_klass()) {
-    return 0;
-  }
   if (_field_index_map == NULL) {
     return compute_field_index_map();
   } else {
     return _field_index_map->length();
   }
< prev index next >