On Fri, 4 Dec 2026 04:15:18 GMT, John R Rose <[email protected]> wrote:
>> 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. Good to have more special cases identified. Especially in this case, I think it is worth having the high frequency of `new` explicitly named to aid the reader "`new` or other object creation expression", etc. as the other situations are into expert user territory. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/34140#discussion_r4795379200
