Revise the initialization flow of interface as per specs - #24567
Revise the initialization flow of interface as per specs#24567lzhou2025 wants to merge 1 commit into
Conversation
a5f41b3 to
573daec
Compare
573daec to
223f3de
Compare
| if (VM_VMHelpers::exceptionPending(currentThread)) { | ||
| goto initFailed; | ||
|
|
||
| /* Do not initialize the superclass java.lang.Object of interfaces */ |
There was a problem hiding this comment.
It ensures that that part of codes is only applicable to java class, not interfaces.
There was a problem hiding this comment.
The class java.lang.Object is initialized very early in the boot sequence and should be initialized before any interface would be considered. What problem does this address?
There was a problem hiding this comment.
That is correct. As a state machine implementation, if it's Object or any other Class, is already initialized in next loop check, it will come back with nothing.
There was a problem hiding this comment.
What problem does this address?
I don't think you answered my question.
There was a problem hiding this comment.
In the context of interfaces with default method,
interface I {
boolean v = out("I");
default void i() {}
}
interface J extends I {
boolean v = out("J");
default void j() {}
}
J doesn't have Object as the superclass (but internally representation of data structure it's). The changes skip the block for the superclass initialization. Then proceed to next block is for the J's super interface (I) which is initialized first, then come back to J initialization.
There was a problem hiding this comment.
The changes will initialize all super interfaces here https://github.com/eclipse-openj9/openj9/pull/24567/changes#diff-935d02710f1a4a3eeec9b2cae8ff8ef4bb33f0c28b0bee105ec9a42feb33eb26R734. But currently it's not used for the initialization of super interfaces of an interface, only applicable to a Java classes super interfaces.
There was a problem hiding this comment.
Perhaps the interfaces are considered in the wrong order, but that's not my question. Skipping the (re-)initialization check for Object should make no difference. Why is that part of this change?
There was a problem hiding this comment.
The changes make the initialization of a class or an interface compliant with the spec.
There was a problem hiding this comment.
From a regression test run there is no new issue so far.
e9f4894 to
0a55a6b
Compare
0a55a6b to
73a1ed6
Compare
08ae828 to
8e380fa
Compare
|
jenkins test sanity,extended.functional zlinux jdk11,jdk17,jdk25 |
8e380fa to
49ae8d8
Compare
|
For the record, the build in progress is https://openj9-jenkins.osuosl.org/job/PullRequest-OpenJ9/9862: The results should not be invalidated by recent changes. However, #24567 (review) has not been addressed. |
92d66d3 to
59d5d6f
Compare
As per Java Language and JVM Specs, the initialization is changed to initialize Java interface's super interfaces if applicable with default method. Fixes: eclipse-openj9#24153
59d5d6f to
75ccc7c
Compare
As per Java Language and JVM Specs, the initialization is changed to initialize Java interface's super interfaces if applicable with default method.
Fixes: #24153