Unsafe value access
paul.sandoz at oracle.com
Thu Jun 22 19:18:12 UTC 2017
To start working on VarHandle integration i first of all need unsafe access to values held within objects. For a most basic initial implementation we can use a global lock to preserve atomicity and memory ordering effects and defer the thinking about more sophisticated locking (seq locks etc), read-mody-write operations and other memory order effects to a another day.
For these purposes we just require two methods:
__Value getValue(Object base, long offset, Class<? extends Value> vt)
void putValue(Object base, long offset, Class<? extends Value> vt, __Value v);
I included Class parameter for the value type token.
How feasible would it be to implement such methods?
If people point me to the hotspot interpreter code for getfield/putfield implementations for values i might be able to make some progress. Once that is done we could then consider C1/C2 support.
More information about the valhalla-dev