Selectively Shifting and Constraining Computation

John Rose john.r.rose at oracle.com
Tue Oct 18 17:58:55 UTC 2022


Replacing a vanilla invoke by something more specific strikes me as an example of adding a runtime constraint. The call site is constrained to process only particular argument types or values, depending on what the indy turns into.  It could be open-coded as well, but that gives the JIT less info.  

The JIT makes good use of all such constraints. More generally the JIT benefits from type restrictions and constant replacement everywhere. 

> On Oct 13, 2022, at 12:04 PM, Mark Reinhold <mark.reinhold at oracle.com> wrote:
> 
> 2022/10/13 11:43:29 -0700, Remi Forax <forax at univ-mlv.fr>:
>> I will argue that moving from compile time to runtime is also a form
>> of condensation, by example transforming an invokevirtual call to an
>> invokedynamic allows to consider some arguments as effectively
>> constants helping the JIT to generate better assembly code (often more
>> compact) by delaying the linking until the actual values are
>> seen.
> 
> That’s certainly a form of shifting, and we could generalize the
> condenser concept slightly to allow such forward shifting should
> interesting use cases arise.
> 
> - Mark


More information about the leyden-dev mailing list