[lworld] RFR: 8351979: Improve verification error messages for strict fields
Matias Saavedra Silva
matsaave at openjdk.org
Fri Mar 14 17:08:14 UTC 2025
On Fri, 14 Mar 2025 16:26:25 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> src/hotspot/share/classfile/stackMapFrame.cpp line 71:
>>
>>> 69: sig->as_C_string(),
>>> 70: klass->name()->as_C_string()
>>> 71: );
>>
>> I wonder if you need a ResourceMark here. Also, I wonder if you could use a stringStream here and concatenate all the names and signatures of the unset fields?
>
> Placing a ResourceMark here messes with the error message so I opted not to use one.
Regarding stringStream, there's a chance that approach would flood the log output in some cases. Although most realistic cases would have a few strict instance fields per class, it is still possible to have a large amount and create a massive error message that could be hard to trace.
I think a minimal but descriptive error message is sufficient here and then users can use `-Xlog:verification` for the complete list of fields.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1400#discussion_r1995950614
More information about the valhalla-dev
mailing list