RFR: 8346836: C2: Introduce a way to verify the correctness of ConstraintCastNodes at runtime [v5]

Quan Anh Mai qamai at openjdk.org
Sat Apr 5 06:46:52 UTC 2025


On Fri, 7 Feb 2025 17:11:22 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> Quan Anh Mai has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision:
>> 
>>  - Merge branch 'master' into verifycast
>>  - better comments
>>  - move test to a new file, add block_comment
>>  - add tests
>>  - make VerifyConstraintCast uint, better debug info
>>  - Merge branch 'master' into verifycast
>>  - Introduce VerifyConstraintCasts
>
> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 852:
> 
>> 850:   movl(rcx, type->_lo);
>> 851:   movl(rdx, type->_hi);
>> 852:   hlt(); // hlt so we have the stack trace
> 
> That's interesting. Sounds like a problem in `NativeStackPrinter::print_stack()`.
> 
> Speaking of debugging output, a call into a local helper function (encapsulating pretty printing logic) followed by a hlt call will do the job. But, considering the usages are in-line and quite common I suggest to make it conditional (guarded by a flag). It is possible to recover all 3 values from generated code if needed and turn on error reporting (specify the diagnostic flag) when reproducing failures.

I have made a helper function that will print the error message together with the parameters, the stack printing is still problematic, though.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22880#discussion_r2029786565


More information about the hotspot-compiler-dev mailing list