<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div>
<blockquote type="cite">
<div>On Jan 29, 2024, at 9:06 AM, Remi Forax <forax@univ-mlv.fr> wrote:</div>
<br class="Apple-interchange-newline">
<div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">-----
 Original Message -----</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
From: "Clement Cherlin" <ccherlin@gmail.com><br>
To: "Valhalla Expert Group Observers" <valhalla-spec-observers@openjdk.org><br>
Cc: "daniel smith" <daniel.smith@oracle.com>, "valhalla-spec-experts" <valhalla-spec-experts@openjdk.java.net><br>
Sent: Monday, January 29, 2024 4:30:01 PM<br>
Subject: Re: JVMS changes for JEP 401<br>
</blockquote>
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<blockquote type="cite">On Tue, Jan 23, 2024 at 7:11 PM Dan Smith <daniel.smith@oracle.com> wrote:<br>
<blockquote type="cite"><br>
I've posted a revised spec change document for JEP 401, Value Classes and<br>
Objects, here:<br>
<br>
https://cr.openjdk.org/~dlsmith/jep401/jep401-20240116/specs/value-objects-jvms.html<br>
</blockquote>
</blockquote>
<br>
[snip]<br>
<br>
<blockquote type="cite">
<blockquote type="cite">- The 4.9.2 rule about ACC_STRICT is hard to parse, will be rephrased somehow<br>
<br>
- 2.4 should say more about "sameness" as it relates to "identity"<br>
</blockquote>
</blockquote>
<br>
On Tue, Jan 23, 2024 at 8:15 PM - <liangchenblue@gmail.com> wrote:<br>
<blockquote type="cite"><br>
Hi Dan,<br>
Thanks for sharing this document! It looks great!<br>
There's a typo in section 2.4, where the definition of "element type" for an<br>
array type is accidentally removed.<br>
<br>
The reference to the "start of object construction" can probably be changed to<br>
"before the super-call," taken from John's "Constructive Classes" essay. [1]<br>
The 4.9.2 rule is correct;<br>
</blockquote>
<br>
Unless I'm mistaken, the rule in 4.9.2 is not correct.<br>
<br>
From the proposal:<br>
<blockquote type="cite">
<blockquote type="cite">An instance field of this declared in the current class with its ACC_STRICT flag<br>
set may be assigned by a putfield instruction occurring in an instance<br>
initialization method only if another instance initialization method has not<br>
yet been called.<br>
</blockquote>
</blockquote>
<br>
As I understand the current design intent, a constructor that calls<br>
'this' is forbidden from assigning to a strict field, because that<br>
will lead to a duplicate assignment in a constructor that calls<br>
'super'.<br>
<br>
This language appears to say the opposite. It seems to state that only<br>
the first constructor of the current class can assign the class's<br>
strict instance fields. If that is the case, then further constructors<br>
(including the one that calls 'super') are forbidden from assigning to<br>
strict instance fields.<br>
</blockquote>
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Hello,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">the
 problem is not duplicate assignment, as you said that part of the spec allows that,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">the
 problem is assignment of final fields after a call to super() or this() because when the assignment occurs, 'this' may have already leaked to another context.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
</div>
</blockquote>
<div><br>
</div>
<div>Right.</div>
<div><br>
</div>
<div>There is a *language* rule that final fields must not be assigned more than once. (Specifically, they must be definitely unassigned before their assignment; we'll add a rule that final fields must be definitely assigned before a 'this()' call.)</div>
<div><br>
</div>
<div>In the *JVM*, the only new thing we're guarding against is assignments after the constructor call. All assignments before a constructor call, duplicate or not, are allowed.</div>
</div>
</body>
</html>