| Other |
|---|
| repo-valhallaResolved |
|
Blocks :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
Currently, Unsafe.makePrivateBuffer returns an inline type. As a result, C2 attempts scalarization which leads to incorrect results.
We would need to:
- Make sure private buffers are never scalarized (also not in safepoints)
- Be careful when removing redundant allocations to not replace larval buffer allocations by "normal" buffer allocations
- Make sure the Unsafe.get*/put* operations have an effect
- Scalarize only after finishPrivateBuffer
This manifests, for example, with TestIntrinsics when being executed with -XX:DisableIntrinsic=_putInt because the call to Unsafe.putInt has no effect on the scalarized inline type.
Also, code like this currently crashes C2's typesystem:
MyValue incrementAndCheckUnsafe() {
MyValue vt = U.makePrivateBuffer(this);
U.putInt(vt, X_OFFSET, x + 1);
U.putInt(vt, Y_OFFSET, y + 1);
return vt;
}
This also manifests with tests being executed with -XX:+DeoptimizeALot.
|