mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 20:44:41 +02:00
6653795: C2 intrinsic for Unsafe.getAddress performs pointer sign extension on 32-bit systems
Native pointers less than 64 bits wide should be extended as an unsigned number. Reviewed-by: kvn, kevinw
This commit is contained in:
parent
93c0cc2aa8
commit
1516f610a1
5 changed files with 83 additions and 1 deletions
|
@ -1125,6 +1125,17 @@ Node* GraphKit::ConvI2L(Node* offset) {
|
|||
}
|
||||
return _gvn.transform( new (C) ConvI2LNode(offset));
|
||||
}
|
||||
|
||||
Node* GraphKit::ConvI2UL(Node* offset) {
|
||||
juint offset_con = (juint) find_int_con(offset, Type::OffsetBot);
|
||||
if (offset_con != (juint) Type::OffsetBot) {
|
||||
return longcon((julong) offset_con);
|
||||
}
|
||||
Node* conv = _gvn.transform( new (C) ConvI2LNode(offset));
|
||||
Node* mask = _gvn.transform( ConLNode::make(C, (julong) max_juint) );
|
||||
return _gvn.transform( new (C) AndLNode(conv, mask) );
|
||||
}
|
||||
|
||||
Node* GraphKit::ConvL2I(Node* offset) {
|
||||
// short-circuit a common case
|
||||
jlong offset_con = find_long_con(offset, (jlong)Type::OffsetBot);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue