Graal final field treatment with respect to optimizations

Thomas Wuerthinger thomas.wuerthinger at oracle.com
Tue Apr 28 08:16:21 UTC 2015


We have an optimization for our Truffle object model that always speculates on the “final” property of a value placeholder (e.g., global variable slot or field) independent of whether the placeholder was explicitly declared “final” by the programmer. This works transitively also for chains of accesses. The optimization is in place for Truffle languages such as JavaScript, Ruby, or Smalltalk. We have a research project to also run Java on top of the Truffle layer such that Java could also profit from this approach.

- thomas

> On 28 Apr 2015, at 00:02, Vitaly Davidovich <vitalyd at gmail.com> wrote:
> 
> That's good to know, but I would be quite upset if "new int[2].length == 2"
> didn't fold :) In the cases I'm thinking of, the allocations aren't part of
> the inlining horizon; in fact, the allocated objects live for a long time,
> possibly eternal, but they're not constants to the compiler.



More information about the graal-dev mailing list