[code-reflection] RFR: Improved error message on OpenCLBackend if Reflect annotation is missing on transitive methods from kernel method

Nadeesh TV ntv at openjdk.org
Thu Jan 1 23:20:23 UTC 2026


On Thu, 1 Jan 2026 23:07:10 GMT, Gary Frost <gfrost at openjdk.org> wrote:

>>>I suspect that there is a 'dangling' else in there that is allowing us to progress if a code model could not be located.
>> 
>> Problem is that there is no [else](https://github.com/openjdk/babylon/blob/code-reflection/hat/core/src/main/java/hat/BufferTagger.java#L81) . We inline functions that have code model available and ignoring the other case. Therefore, there also it's the same issue . InvokeOp like `hat.buffer.S32Array::array(long)` etc. will reach the else part and thus we need a criteria to differentiate between  `hat.buffer.S32Array::array()`  and `squareitWithoutReflectAnnotation`.
>
> On my phone, so analysis limited.
> 
> Look at the conditional on line 70 (BufferTagger) it is looking for methods with a code model.... it has no else... my guess is we can detect a call for which we can resolve a  Java.lang.rflect.Method... but which has no CodeModel....

I am assuming that you have missed my comment that I posted couple of minutes ago. 
> can resolve a Java.lang.rflect.Method... but which has no CodeModel....

`hat.buffer.S32Array::array(..)` etc.. will also fall into this category not just `squareitWithoutReflectAnnotation`. Therefore, this criteria won't be sufficient.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/798#discussion_r2656667071


More information about the babylon-dev mailing list