aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/opto/graphKit.cpp
diff options
context:
space:
mode:
authorpoonam <none@none>2014-03-24 08:43:10 -0700
committerpoonam <none@none>2014-03-24 08:43:10 -0700
commit228c004f0e916d4ea729f2c203313ba8f3df4373 (patch)
tree5759c8dae459f5d1647a2e37c3aa737ee1181fa9 /src/share/vm/opto/graphKit.cpp
parent25db7423e54d1b78d1e4c50663034765904f8fdd (diff)
6653795: C2 intrinsic for Unsafe.getAddress performs pointer sign extension on 32-bit systems
Summary: Native pointers less than 64 bits wide should be extended as an unsigned number. Reviewed-by: kvn, kevinw
Diffstat (limited to 'src/share/vm/opto/graphKit.cpp')
-rw-r--r--src/share/vm/opto/graphKit.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/share/vm/opto/graphKit.cpp b/src/share/vm/opto/graphKit.cpp
index 7a154c557..28df4c276 100644
--- a/src/share/vm/opto/graphKit.cpp
+++ b/src/share/vm/opto/graphKit.cpp
@@ -1124,6 +1124,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);