Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8098630 | emb-9 | Coleen Phillimore | P4 | Resolved | Fixed | team |
Recent changes for to meet the jdk8 deadline have left some cleanup items. These are cosmetic but because the code is so complex now, the cosmetic problems make this code even harder to understand and more likely to create bugs. See referenced bugs.
The specific things that need to be done is to fix the parameter lists in linkResolver to 1. not wrap multiple lines and 2. not pass non-const reference parameters because at the call site you have no idea that these are output parameters.
Other things in linkResolver, there are similar but different functions: lookup_instance_method_in_klasses vs. lookup_method_in_klasses. The former skips statics. It would be better to have an InstanceKlass::uncached_lookup_instance_method() which skips statics and that could be used instead of the following code in klassVtable.cpp also.
Method* mo = InstanceKlass::cast(super)->lookup_method(name, signature);
+ while (mo != NULL && mo->access_flags().is_static()
+ && mo->method_holder() != NULL
+ && mo->method_holder()->super() != NULL)
+ {
+ mo = mo->method_holder()->super()->uncached_lookup_method(name, signature);
+ }
A cleanup pass of link resolution code should be done before the suggested complete rewrite so that it's clearer what it does. This is technical debt.
The specific things that need to be done is to fix the parameter lists in linkResolver to 1. not wrap multiple lines and 2. not pass non-const reference parameters because at the call site you have no idea that these are output parameters.
Other things in linkResolver, there are similar but different functions: lookup_instance_method_in_klasses vs. lookup_method_in_klasses. The former skips statics. It would be better to have an InstanceKlass::uncached_lookup_instance_method() which skips statics and that could be used instead of the following code in klassVtable.cpp also.
Method* mo = InstanceKlass::cast(super)->lookup_method(name, signature);
+ while (mo != NULL && mo->access_flags().is_static()
+ && mo->method_holder() != NULL
+ && mo->method_holder()->super() != NULL)
+ {
+ mo = mo->method_holder()->super()->uncached_lookup_method(name, signature);
+ }
A cleanup pass of link resolution code should be done before the suggested complete rewrite so that it's clearer what it does. This is technical debt.
- backported by
-
JDK-8098630 Clean up linkResolver code
-
- Resolved
-
- duplicates
-
JDK-8031820 NPG: Fix remaining references to metadata as oops in comments
-
- Closed
-
- relates to
-
JDK-8026066 InvokeInterface needs to throw ICCE for static methods
-
- Closed
-
-
JDK-8028438 Lambda: default methods static superclass method masking default
-
- Closed
-