On Wed, 24 Jan 2024 18:56:15 GMT, Aleksey Shipilev <[email protected]> wrote:
> > Naive question: the right way to use this would be almost invariably be
> > like this:
> > ```
> > if (isCompileConstant(foo) && fooHasCertainStaticProperties(foo)) {
> > // fast-path
> > }
> > // slow path
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Right?
>
> Yes, I think so.
But then whatever is in the fast path and `fooHasCertainStaticProperties` are
never profiled because never executed by the interpreter or c1. So
`fooHasCertainStaticProperties` will likely not be inlined and c2 will do a
poor (or rather not as good as you'd like) job of compiling whatever is in the
fast path.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17527#issuecomment-1909531426