-
Notifications
You must be signed in to change notification settings - Fork 736
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
Remove special treatment of <init> for value types #16357
Remove special treatment of <init> for value types #16357
Conversation
Early prototype handling of value type classes used <init> as a special factory method name distinct from its use as an instance initialization method name. That has been dropped in favor of <vnew> as a factory method name for value type classes. This change removes the special treatment of <init> as a value type factory method name from TR_ResolvedJ9Method::isConstructor. Signed-off-by: Henry Zongaro <[email protected]>
6399249
to
ff992e8
Compare
I found a comment as below in the VM code. Do we still need special treatment for value abstract class in the JIT? openj9/runtime/bcutil/cfreader.c Lines 1804 to 1807 in 7a8923b
|
Good question! My understanding is that an abstract class won't be a value class, but it can have a subclass that is a value class. A concrete value class that is a subclass of such an abstract class won't have an My understanding is that an abstract class's |
Thanks for the clarification @hzongaro!
I discussed the above code with @hangshao0. The latest spec states: |
Thanks, Annabelle @a7ehuo. In response to my comment:
you wrote:
Sorry about that! I was looking at an older version of the draft spec. The same draft that you quoted goes on to state this:
So a value class shouldn't have an <init> method. If I understand Hang's comment in openj9/runtime/bcutil/cfreader.c Lines 1804 to 1807 in 7a8923b
<init> methods for abstract value classes. Hang @hangshao0, can you confirm that? That sounds like a bug.
Regardless, I think it's still safe if this change doesn't provide any special case handling for that case, because such an |
Yes, it is the behaviour of javac for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for all the clarification
Jenkins test sanity,extended xlinuxval jdknext |
Jenkins test sanity all jdk8,jdk11,jdk17 |
I believe the sanity.functional failure on x86 Mac was due to a long-standing intermittent problem: issue #13577 |
Jenkins test sanity.functional x86-64_mac jdk17 |
Daryl @0xdaryl, may I ask you to review this pull request? |
Early prototype handling of value type classes used
<init>
as a special factory method name distinct from its use as an instance initialization method name. That has been dropped in favor of<vnew>
as a factory method name for value type classes. This change removes the special treatment of<init>
as a value type factory method name fromTR_ResolvedJ9Method::isConstructor
.Fixes #14959