8007153: Ensure that MethodParameters API works properly with RedefineClasses

Adds code to HotSpot to properly update MethodParameter attributes' constant pool indexes when redefineClasses is called

Reviewed-by: coleenp, sspitsyn
This commit is contained in:
Eric McCorkle 2013-02-19 11:36:52 -05:00
parent 1439d121c2
commit b56b3bc9aa
2 changed files with 14 additions and 0 deletions

View file

@ -1558,6 +1558,18 @@ void VM_RedefineClasses::rewrite_cp_refs_in_method(methodHandle method,
} 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()