changeset 8841:53f4040e809c

Merge
author acorn
date Wed, 27 Mar 2013 16:31:00 -0700
parents b601102d00c8 (diff) cd3089a56438 (current diff)
children f044c45bee68
files
diffstat 4 files changed, 31 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/oops/constMethod.cpp	Wed Mar 27 14:10:59 2013 -0400
+++ b/src/share/vm/oops/constMethod.cpp	Wed Mar 27 16:31:00 2013 -0700
@@ -363,6 +363,26 @@
   return (AnnotationArray**)constMethod_end() - offset;
 }
 
+// copy annotations from 'cm' to 'this'
+void ConstMethod::copy_annotations_from(ConstMethod* cm) {
+  if (cm->has_method_annotations()) {
+    assert(has_method_annotations(), "should be allocated already");
+    set_method_annotations(cm->method_annotations());
+  }
+  if (cm->has_parameter_annotations()) {
+    assert(has_parameter_annotations(), "should be allocated already");
+    set_parameter_annotations(cm->parameter_annotations());
+  }
+  if (cm->has_type_annotations()) {
+    assert(has_type_annotations(), "should be allocated already");
+    set_type_annotations(cm->type_annotations());
+  }
+  if (cm->has_default_annotations()) {
+    assert(has_default_annotations(), "should be allocated already");
+    set_default_annotations(cm->default_annotations());
+  }
+}
+
 // Printing
 
 void ConstMethod::print_on(outputStream* st) const {
--- a/src/share/vm/oops/constMethod.hpp	Wed Mar 27 14:10:59 2013 -0400
+++ b/src/share/vm/oops/constMethod.hpp	Wed Mar 27 16:31:00 2013 -0700
@@ -441,6 +441,9 @@
     return has_default_annotations() ? default_annotations()->length() : 0;
   }
 
+  // Copy annotations from other ConstMethod
+  void copy_annotations_from(ConstMethod* cm);
+
   // byte codes
   void    set_code(address code) {
     if (code_size() > 0) {
--- a/src/share/vm/oops/method.cpp	Wed Mar 27 14:10:59 2013 -0400
+++ b/src/share/vm/oops/method.cpp	Wed Mar 27 16:31:00 2013 -0700
@@ -1170,6 +1170,8 @@
     newm->set_stackmap_data(stackmap_data);
   }
 
+  // copy annotations over to new method
+  newcm->copy_annotations_from(cm);
   return newm;
 }
 
--- a/test/runtime/7116786/Test7116786.java	Wed Mar 27 14:10:59 2013 -0400
+++ b/test/runtime/7116786/Test7116786.java	Wed Mar 27 16:31:00 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -338,9 +338,12 @@
                  "invalid constant pool index in ldc",
                  "Invalid index in ldc"),
 
-        new Case("case58", "verifier.cpp", true, "verify_switch",
+        /* No longer a valid test case for bytecode version >= 51. Nonzero
+         * padding bytes are permitted with lookupswitch and tableswitch
+         * bytecodes as of JVMS 3d edition */
+        new Case("case58", "verifier.cpp", false, "verify_switch",
                  "bad switch padding",
-                 "Nonzero padding byte in lookswitch or tableswitch"),
+                 "Nonzero padding byte in lookupswitch or tableswitch"),
 
         new Case("case59", "verifier.cpp", true, "verify_switch",
                  "tableswitch low is greater than high",