8019632: Method parameters are not copied in clone_with_new_data
authoremc
Mon, 22 Jul 2013 17:57:42 -0400
changeset 18951 eb19defdc889
parent 18950 5d4d5e3c34c3
child 18954 12224a2c5708
8019632: Method parameters are not copied in clone_with_new_data Summary: Add code to copy method parameters data in clone_with_new_data Reviewed-by: coleenp, sspitsyn
hotspot/src/share/vm/oops/method.cpp
--- a/hotspot/src/share/vm/oops/method.cpp	Fri Jul 19 11:17:19 2013 -0700
+++ b/hotspot/src/share/vm/oops/method.cpp	Mon Jul 22 17:57:42 2013 -0400
@@ -1163,6 +1163,7 @@
   newm->constMethod()->set_constMethod_size(new_const_method_size);
   newm->set_method_size(new_method_size);
   assert(newm->code_size() == new_code_length, "check");
+  assert(newm->method_parameters_length() == method_parameters_len, "check");
   assert(newm->checked_exceptions_length() == checked_exceptions_len, "check");
   assert(newm->exception_table_length() == exception_table_len, "check");
   assert(newm->localvariable_table_length() == localvariable_len, "check");
@@ -1174,6 +1175,12 @@
            new_compressed_linenumber_table,
            new_compressed_linenumber_size);
   }
+  // Copy method_parameters
+  if (method_parameters_len > 0) {
+    memcpy(newm->method_parameters_start(),
+           m->method_parameters_start(),
+           method_parameters_len * sizeof(MethodParametersElement));
+  }
   // Copy checked_exceptions
   if (checked_exceptions_len > 0) {
     memcpy(newm->checked_exceptions_start(),