mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
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:
parent
1439d121c2
commit
b56b3bc9aa
2 changed files with 14 additions and 0 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue