review request (M): 6711908: JVM needs direct access to some annotations

John Rose john.r.rose at oracle.com
Wed Jul 11 23:54:22 PDT 2012


On Jul 11, 2012, at 5:25 PM, Vladimir Kozlov wrote:

> > But I'll change it if you insist.
> 
> Please, change. Also put final klass settings "Fill in field values from parse_classfile_attributes" in a separate ClassFileParser method.


Done.  Here is the updated webrev:
  http://cr.openjdk.java.net/~jrose/6711908/webrev.01

(See synopsis below.)

— John


@@ -62,6 +64,22 @@
   typeArrayHandle _inner_classes;
   typeArrayHandle _annotations;
 
+  void set_class_synthetic_flag(bool x)           { _synthetic_flag = x; }
+  void set_class_sourcefile(Symbol* x)            { _sourcefile = x; }
+  void set_class_generic_signature(Symbol* x)     { _generic_signature = x; }
+  void set_class_sde_symbol(Symbol* x)            { _sde_symbol = x; }
+  void set_class_inner_classes(typeArrayHandle x) { _inner_classes = x; }
+  void set_class_annotations(typeArrayHandle x)   { _annotations = x; }
+  void init_parsed_class_attributes() {
+    _synthetic_flag = false;
+    _sourcefile = NULL;
+    _generic_signature = NULL;
+    // initialize the other flags too:
+    _has_finalizer = _has_empty_finalizer = _has_vanilla_constructor = false;
+    _max_bootstrap_specifier_index = -1;
+  }
+  void apply_parsed_class_attributes(instanceKlassHandle k);  // update k
+
   class AnnotationCollector {
   public:
     enum Location { _in_field, _in_method, _in_class };


@@ -2866,6 +2863,21 @@
   }
 }
 
+void ClassFileParser::apply_parsed_class_attributes(instanceKlassHandle k) {
+  if (_synthetic_flag)
+    k->set_is_synthetic();
+  if (_sourcefile != NULL) {
+    _sourcefile->increment_refcount();
+    k->set_source_file_name(_sourcefile);
+  }
+  if (_generic_signature != NULL) {
+    _generic_signature->increment_refcount();
+    k->set_generic_signature(_generic_signature);
+  }
+  k->set_source_debug_extension(_sde_symbol);  // increment_refcount inside
+  k->set_inner_classes(_inner_classes());
+  k->set_class_annotations(_annotations());
+}
 
 typeArrayHandle ClassFileParser::assemble_annotations(u1* runtime_visible_annotations,
                                                       int runtime_visible_annotations_length,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20120711/d39db1e1/attachment.html 


More information about the hotspot-compiler-dev mailing list