New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<clinit> sometimes will not be invoked when calling static methods at first. #12016
Comments
@tajila fyi |
The issue in test 1 appears to be that the ConstantPool code is resolving the static method without running the |
Nope, that's not it - it appears to be somehow caused by the |
The entry is resolved by this:
|
I have all of the testcases working as expected, but the code needs some reworking before it can be committed. |
- do not load classes in the "ifLoaded" calls - never intitialize classes in the natives - do not update the constant pool when querying from the natives Fixes: eclipse-openj9#12016 [ci skip] Signed-off-by: Graham Chapman <graham_chapman@ca.ibm.com>
- do not load classes in the "ifLoaded" calls - never intitialize classes in the natives - do not update the constant pool when querying from the natives Fixes: eclipse-openj9#12016 [ci skip] Signed-off-by: Graham Chapman <graham_chapman@ca.ibm.com>
Considering test cases below:
In this case,
Test
class will throw an exception in<clinit>
, then run with OpenJ9 and Hotspot respectively. The result is:We will find that, with OpenJ9,
<clinit>
won't be invoked whenTest.test
being invoked and untilTest.a
was acquired.We can also find that OpenJ9 can't get the method by
cp.getMethodAtIfLoaded(i)
but Hotspot can.If we change
cp.getMethodAtIfLoaded(i)
tocp.getMethodAt(i)
, there will be more different behaviors between OpenJ9 and HotspotResult:
We will find that
<clinit>
was invoked atcp.getMethodAt(i)
with OpenJ9 and still unable to get theTest.test
method.If
Test
class no longer throws an exception:Result:
In this case, OpenJ9 can get
test
method correctly, but<clinit>
was still invoked earlier than Hotspot.The text was updated successfully, but these errors were encountered: