readonly arrays

Gilles Duboscq duboscq at
Fri Jun 20 08:16:37 UTC 2014

tl;dr: not yet.

The concept of "array with final content" is unfortunately impossible
to express in vanilla Java.
However both HotSpot and Graal have support for those to some degree.
For example, HotSpot knows about the java.lang.invoke.Stable annotation.
In Truffle the
annotation has similar effects.
In Graal we also have the annotation.

There's been a few prototypes for good support of this concepts in
Graal but it's not so well supported currently.
The problem is that all of the annotation based workaround mentioned
above all work at the field level while this information should really
be in the type.

I think we will need it anyway at some point. First because it would
probably allow us to unify the 3 different concepts from above. And
secondly because it may become important to be able to run LambdaForms
with good performances.


On Fri, Jun 20, 2014 at 12:41 AM, Tom Deneau <tom.deneau at> wrote:
> Does graal have any concept of marking an array as having constant primitive values?
> For instance on hsa such an array could be put in readonly memory and compiled into the kernel rather than accessed thru global memory.
> -- Tom

More information about the graal-dev mailing list