changeset 476:0ffb542eb0de

annot: update for review comments
author jrose
date Thu, 12 Jul 2012 00:37:44 -0700
parents 7b29f3a51eea
children 71016edd5799
files annot-6711908.patch
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/annot-6711908.patch	Wed Jul 11 23:33:23 2012 -0700
+++ b/annot-6711908.patch	Thu Jul 12 00:37:44 2012 -0700
@@ -1,20 +1,23 @@
 6711908: JVM needs direct access to some annotations
 Summary: Add annotation extraction code to class file parser.
-Contributed-by: jrose, michael.haupt@oracle.com
+Contributed-by: michael.haupt@oracle.com
 Reviewed-by: twisti, jrose, kvn
 
 diff --git a/src/share/vm/c1/c1_GraphBuilder.cpp b/src/share/vm/c1/c1_GraphBuilder.cpp
 --- a/src/share/vm/c1/c1_GraphBuilder.cpp
 +++ b/src/share/vm/c1/c1_GraphBuilder.cpp
-@@ -3505,7 +3505,7 @@
+@@ -3505,8 +3505,10 @@
    }
  
    // now perform tests that are based on flag settings
 -  if (callee->should_inline()) {
 +  if (callee->force_inline() || callee->should_inline()) {
      // ignore heuristic controls on inlining
++    if (callee->force_inline())
++      CompileTask::print_inlining(callee, scope()->level(), bci(), "force inline by annotation");
    } else {
      if (inline_level() > MaxInlineLevel                         ) INLINE_BAILOUT("too-deep inlining");
+     if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("too-deep recursive inlining");
 @@ -3531,7 +3531,7 @@
    }
  
@@ -92,7 +95,7 @@
 +// Skip an annotation.  Return >=limit if there is any problem.
 +int ClassFileParser::skip_annotation(u1* buffer, int limit, int index) {
 +  // annotation := atype:u2 do(nmem:u2) {member:u2 value}
-+  // value := switch (tag:u1) { ... } 
++  // value := switch (tag:u1) { ... }
 +  index += 2;  // skip atype
 +  if ((index += 2) >= limit)  return limit;  // read nmem
 +  int nmem = Bytes::get_Java_u2(buffer+index-2);
@@ -222,7 +225,7 @@
 +}
 +
 +void ClassFileParser::FieldAnnotationCollector::apply_to(FieldInfo* f) {
-+  guarantee(false, "no field annotations yet");
++  fatal("no field annotations yet");
 +}
 +
 +void ClassFileParser::MethodAnnotationCollector::apply_to(methodHandle m) {
@@ -231,7 +234,7 @@
 +}
 +
 +void ClassFileParser::ClassAnnotationCollector::apply_to(instanceKlassHandle k) {
-+  guarantee(false, "no class annotations yet");
++  fatal("no class annotations yet");
 +}
 +
 +
@@ -362,7 +365,7 @@
    ClassFileStream* cfs = stream();
    // Set inner classes attribute to default sentinel
 -  k->set_inner_classes(Universe::the_empty_short_array());
-+  _inner_classes = typeArrayHandle(THREAD, Universe::the_empty_short_array());
++  set_class_inner_classes(typeArrayHandle(THREAD, Universe::the_empty_short_array()));
    cfs->guarantee_more(2, CHECK);  // attributes_count
    u2 attributes_count = cfs->get_u2_fast();
    bool parsed_sourcefile_attribute = false;
@@ -420,7 +423,7 @@
                                                       runtime_invisible_annotations_length,
                                                       CHECK);
 -  k->set_class_annotations(annotations());
-+  _annotations = annotations;
++  set_class_annotations(annotations);
  
    if (parsed_innerclasses_attribute || parsed_enclosingmethod_attribute) {
      u2 num_of_classes = parse_classfile_inner_classes_attribute(