Mercurial > hg > graal-compiler
comparison src/share/vm/opto/graphKit.cpp @ 17776:9ab9f254cfe2
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
author | poonam |
---|---|
date | Mon, 24 Mar 2014 08:43:10 -0700 |
parents | 62825ea7e51f |
children | 606acabe7b5c |
comparison
equal
deleted
inserted
replaced
17772:7d175751ef7f | 17776:9ab9f254cfe2 |
---|---|
1122 if (offset_con != Type::OffsetBot) { | 1122 if (offset_con != Type::OffsetBot) { |
1123 return longcon((jlong) offset_con); | 1123 return longcon((jlong) offset_con); |
1124 } | 1124 } |
1125 return _gvn.transform( new (C) ConvI2LNode(offset)); | 1125 return _gvn.transform( new (C) ConvI2LNode(offset)); |
1126 } | 1126 } |
1127 | |
1128 Node* GraphKit::ConvI2UL(Node* offset) { | |
1129 juint offset_con = (juint) find_int_con(offset, Type::OffsetBot); | |
1130 if (offset_con != (juint) Type::OffsetBot) { | |
1131 return longcon((julong) offset_con); | |
1132 } | |
1133 Node* conv = _gvn.transform( new (C) ConvI2LNode(offset)); | |
1134 Node* mask = _gvn.transform( ConLNode::make(C, (julong) max_juint) ); | |
1135 return _gvn.transform( new (C) AndLNode(conv, mask) ); | |
1136 } | |
1137 | |
1127 Node* GraphKit::ConvL2I(Node* offset) { | 1138 Node* GraphKit::ConvL2I(Node* offset) { |
1128 // short-circuit a common case | 1139 // short-circuit a common case |
1129 jlong offset_con = find_long_con(offset, (jlong)Type::OffsetBot); | 1140 jlong offset_con = find_long_con(offset, (jlong)Type::OffsetBot); |
1130 if (offset_con != (jlong)Type::OffsetBot) { | 1141 if (offset_con != (jlong)Type::OffsetBot) { |
1131 return intcon((int) offset_con); | 1142 return intcon((int) offset_con); |