changeset 5638:36b4e9b30322

Automated merge with http://hg.openjdk.java.net/jdk8/tl/hotspot
author briangoetz
date Mon, 28 Oct 2013 21:15:16 -0400
parents 0e55a181cb08 aecf0d7dd6b9
children d31bebcd5635
files .hgtags .jcheck/conf src/share/vm/classfile/defaultMethods.cpp src/share/vm/interpreter/linkResolver.cpp src/share/vm/oops/constantPool.cpp src/share/vm/oops/instanceKlass.cpp src/share/vm/oops/method.hpp src/share/vm/runtime/globals.hpp src/share/vm/utilities/ostream.cpp
diffstat 7 files changed, 48 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Oct 28 12:25:44 2013 -0700
+++ b/.hgtags	Mon Oct 28 21:15:16 2013 -0400
@@ -273,6 +273,7 @@
 54240c1b8e87758f28da2c6a569a926fd9e0910a jdk8-b53
 9e3ae661284dc04185b029d85440fe7811f1ed07 hs24-b21
 e8fb566b94667f88462164defa654203f0ab6820 jdk8-b54
+203d2c0ee7c4fe648464fe2c506bd91003b7a5b7 lambda-b56
 09ea7e0752b306b8ae74713aeb4eb6263e1c6836 hs24-b22
 af0c8a0808516317333dcf9af15567cdd52761ce jdk8-b55
 6124ff4218296c91e4a72f1a76c064892d39d61b jdk8-b56
--- a/.jcheck/conf	Mon Oct 28 12:25:44 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-project=jdk8
--- a/src/share/vm/classfile/classFileParser.cpp	Mon Oct 28 12:25:44 2013 -0700
+++ b/src/share/vm/classfile/classFileParser.cpp	Mon Oct 28 21:15:16 2013 -0400
@@ -2396,6 +2396,7 @@
       runtime_visible_type_annotations_length +
            runtime_invisible_type_annotations_length,
       annotation_default_length,
+      0,
       0);
 
   Method* m = Method::allocate(
--- a/src/share/vm/oops/constMethod.cpp	Mon Oct 28 12:25:44 2013 -0700
+++ b/src/share/vm/oops/constMethod.cpp	Mon Oct 28 21:15:16 2013 -0400
@@ -137,6 +137,9 @@
   if (sizes->default_annotations_length() > 0) {
     extra_bytes += sizeof(AnnotationArray*);
   }
+  if (sizes->target_method_length() > 0) {
+    extra_bytes += sizeof(Method*);
+  }
 
   int extra_words = align_size_up(extra_bytes, BytesPerWord) / BytesPerWord;
   assert(extra_words == extra_bytes/BytesPerWord, "should already be aligned");
@@ -163,6 +166,7 @@
   if (has_parameter_annotations()) offset++;
   if (has_type_annotations()) offset++;
   if (has_default_annotations()) offset++;
+  if (has_target_method()) offset++;
   return (u2*)((AnnotationArray**)constMethod_end() - offset) - 1;
 }
 
@@ -256,6 +260,8 @@
     _flags |= _has_type_annotations;
   if (sizes->default_annotations_length() > 0)
     _flags |= _has_default_annotations;
+  if (sizes->target_method_length() > 0)
+    _flags |= _has_target_method;
 
   // This code is extremely brittle and should possibly be revised.
   // The *_length_addr functions walk backwards through the
@@ -363,6 +369,16 @@
   return (AnnotationArray**)constMethod_end() - offset;
 }
 
+Method** ConstMethod::target_method_addr() const {
+  assert(has_target_method(), "should only be called if overpass target method is present");
+  int offset = 1;
+  if (has_method_annotations()) offset++;
+  if (has_parameter_annotations()) offset++;
+  if (has_type_annotations()) offset++;
+  if (has_default_annotations()) offset++;
+  return (Method**)constMethod_end() - offset;
+}
+
 // copy annotations from 'cm' to 'this'
 void ConstMethod::copy_annotations_from(ConstMethod* cm) {
   if (cm->has_method_annotations()) {
--- a/src/share/vm/oops/constMethod.hpp	Mon Oct 28 12:25:44 2013 -0700
+++ b/src/share/vm/oops/constMethod.hpp	Mon Oct 28 21:15:16 2013 -0400
@@ -86,6 +86,9 @@
 // | generic signature index (u2)                         |
 // |  (indexed from start of constMethodOop)              |
 // |------------------------------------------------------|
+// | word-aligned Method* target_method if overpass       |
+// |  (access flags bit tells if present)                 |
+// |------------------------------------------------------|
 // | annotations arrays - method, parameter, type, default|
 // | pointer to Array<u1> if annotation is present        |
 // |------------------------------------------------------|
@@ -141,7 +144,8 @@
   do_element(method_annotations_length)         \
   do_element(parameter_annotations_length)      \
   do_element(type_annotations_length)           \
-  do_element(default_annotations_length)
+  do_element(default_annotations_length)        \
+  do_element(target_method_length)
 
 #define INLINE_TABLE_DECLARE(sym)    int _##sym;
 #define INLINE_TABLE_PARAM(sym)      int sym,
@@ -193,7 +197,8 @@
     _has_method_annotations = 0x0080,
     _has_parameter_annotations = 0x0100,
     _has_type_annotations = 0x0200,
-    _has_default_annotations = 0x0400
+    _has_default_annotations = 0x0400,
+    _has_target_method = 0x0800
   };
 
   // Bit vector of signature
@@ -395,6 +400,8 @@
   bool has_default_annotations() const
     { return (_flags & _has_default_annotations) != 0; }
 
+  bool has_target_method() const
+    { return (_flags & _has_target_method) != 0; }
 
   AnnotationArray** method_annotations_addr() const;
   AnnotationArray* method_annotations() const  {
@@ -428,6 +435,15 @@
     *(default_annotations_addr()) = anno;
   }
 
+  Method** target_method_addr() const;
+  Method* target_method() const {
+    return has_target_method() ? *(target_method_addr()) : NULL;
+  }
+  void set_target_method(Method* target) {
+    assert(has_target_method(), "only set target method for OVERPASS");
+    *(target_method_addr()) = target;
+  }
+
   int method_annotations_length() const {
     return has_method_annotations() ? method_annotations()->length() : 0;
   }
@@ -440,6 +456,11 @@
   int default_annotations_length() const {
     return has_default_annotations() ? default_annotations()->length() : 0;
   }
+  // This is just used to determine existence, not to count length
+  // returning nonzero is sufficient
+  int target_method_length() const {
+    return has_target_method() ? sizeof(Method*) : 0;
+  }
 
   // Copy annotations from other ConstMethod
   void copy_annotations_from(ConstMethod* cm);
--- a/src/share/vm/oops/method.cpp	Mon Oct 28 12:25:44 2013 -0700
+++ b/src/share/vm/oops/method.cpp	Mon Oct 28 21:15:16 2013 -0400
@@ -1150,6 +1150,7 @@
   int parameter_annotations_len = cm->parameter_annotations_length();
   int type_annotations_len = cm->type_annotations_length();
   int default_annotations_len = cm->default_annotations_length();
+  int target_method_len = cm->target_method_length();
 
   InlineTableSizes sizes(
       localvariable_len,
@@ -1162,6 +1163,7 @@
       parameter_annotations_len,
       type_annotations_len,
       default_annotations_len,
+      target_method_len,
       0);
 
   ClassLoaderData* loader_data = m->method_holder()->class_loader_data();
--- a/src/share/vm/oops/method.hpp	Mon Oct 28 12:25:44 2013 -0700
+++ b/src/share/vm/oops/method.hpp	Mon Oct 28 21:15:16 2013 -0400
@@ -198,7 +198,11 @@
   AnnotationArray* type_annotations() const      {
     return constMethod()->type_annotations();
   }
-
+  // overpass support
+  void set_target_method(Method* target)         {
+     constMethod()->set_target_method(target); 
+  }
+  Method* target_method() const                  { return constMethod()->target_method(); }
 #ifdef CC_INTERP
   void set_result_index(BasicType type);
   int  result_index()                            { return _result_index; }