-
Enhancement
-
Resolution: Duplicate
-
P4
-
repo-valhalla
-
generic
Please consider following pseudo-code:-
class abstract_class {}
value class value_class : public abstract_class {}
callee: () L<abstract_class>;
var obj = Unsafe.makePrivateBuffer(value_object);
return obj;
caller:
var return = (value_class)callee();
Unsafe.putFloat(return, 1.0f);
Currently C2 compiler always create an InlineType IR to represent a value object. In above case makePrivateBuffer will buffer the InlineType node and set the larval flag of newly created AllocateNode node.
Lets say callee is not in-lined (or an explicit JVM flag -XX:-Inline is used), return type signature signifies an abstract identity class, an explicit checkcast over return value will create InlineType node. However, newly created IR type may not carry the larval state of actual returned value.
This may cause problems while processing subsequent Unsafe.put operations.
class abstract_class {}
value class value_class : public abstract_class {}
callee: () L<abstract_class>;
var obj = Unsafe.makePrivateBuffer(value_object);
return obj;
caller:
var return = (value_class)callee();
Unsafe.putFloat(return, 1.0f);
Currently C2 compiler always create an InlineType IR to represent a value object. In above case makePrivateBuffer will buffer the InlineType node and set the larval flag of newly created AllocateNode node.
Lets say callee is not in-lined (or an explicit JVM flag -XX:-Inline is used), return type signature signifies an abstract identity class, an explicit checkcast over return value will create InlineType node. However, newly created IR type may not carry the larval state of actual returned value.
This may cause problems while processing subsequent Unsafe.put operations.
- duplicates
-
JDK-8239003 [lworld] C2 should respect larval state when scalarizing
- Open