Mercurial > hg > truffle
diff src/share/vm/prims/jvmtiRedefineClasses.cpp @ 8068:56c364daccc3
8007153: Ensure that MethodParameters API works properly with RedefineClasses
Summary: Adds code to HotSpot to properly update MethodParameter attributes' constant pool indexes when redefineClasses is called
Reviewed-by: coleenp, sspitsyn
author | emc |
---|---|
date | Tue, 19 Feb 2013 11:36:52 -0500 |
parents | 927a311d00f9 |
children | 6337ca4dcad8 |
line wrap: on
line diff
--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp Mon Feb 18 12:49:53 2013 +0100 +++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp Tue Feb 19 11:36:52 2013 -0500 @@ -1558,6 +1558,18 @@ } break; } } // end for each bytecode + + // We also need to rewrite the parameter name indexes, if there is + // method parameter data present + if(method->has_method_parameters()) { + const int len = method->method_parameters_length(); + MethodParametersElement* elem = method->method_parameters_start(); + + for (int i = 0; i < len; i++) { + const u2 cp_index = elem[i].name_cp_index; + elem[i].name_cp_index = find_new_index(cp_index); + } + } } // end rewrite_cp_refs_in_method()