提交 ebe40ae6 编写于 作者: C coleenp

Merge

...@@ -456,6 +456,8 @@ class Method : public Metadata { ...@@ -456,6 +456,8 @@ class Method : public Metadata {
void print_codes_on(int from, int to, outputStream* st) const PRODUCT_RETURN; void print_codes_on(int from, int to, outputStream* st) const PRODUCT_RETURN;
// method parameters // method parameters
bool has_method_parameters() const
{ return constMethod()->has_method_parameters(); }
int method_parameters_length() const int method_parameters_length() const
{ return constMethod()->method_parameters_length(); } { return constMethod()->method_parameters_length(); }
MethodParametersElement* method_parameters_start() const MethodParametersElement* method_parameters_start() const
......
...@@ -1558,6 +1558,18 @@ void VM_RedefineClasses::rewrite_cp_refs_in_method(methodHandle method, ...@@ -1558,6 +1558,18 @@ void VM_RedefineClasses::rewrite_cp_refs_in_method(methodHandle method,
} break; } break;
} }
} // end for each bytecode } // 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() } // end rewrite_cp_refs_in_method()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册