On Fri, 4 Dec 2026 03:25:51 GMT, Joe Darcy <[email protected]> wrote:

>> The term "creation events" is intended to cover not only expressions like 
>> "new Foo()" but anything else that can create objects.  If we say "new 
>> object creation" or the like there is a risk of users conflating the set of 
>> object creations with the set "new Foo" executions.  Got a better term that 
>> avoids conflation?  (Or an argument that conflation is OK?)
>
> Other than anomalous cases, like a handful of exception objects directly 
> created by HotSpot without a constructor being run, don't all underlying 
> creation events bottom out in a constructor call?

They are easy to forget about.  I think the JNI NewObj API points call a 
constructor, but AllocObj does not.  None of them correspond to what I said up 
top, a new expression executing.  If you trace through clients of things like 
allocobj you run into more than a handful of use cases.  Deserialization is 
one.  Method handles for findConstructor are another (they execute the 
equivalent of a new expression by parts: alloc object, run constructor.  My 
basic point is:  Don’t oversimplify object creation by pretending it is the 
same as "new" expressions.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/34140#discussion_r4795185929

Reply via email to