提交 b73e27dc 编写于 作者: N never

6676841: ClearArrayNode::Identity is incorrect for 64-bit

Summary: ClearArrayNode::Identity should use TypeX instead of TypeInt
Reviewed-by: jrose, kvn, sgoldman
上级 42685e2d
...@@ -1881,7 +1881,7 @@ uint ClearArrayNode::match_edge(uint idx) const { ...@@ -1881,7 +1881,7 @@ uint ClearArrayNode::match_edge(uint idx) const {
//------------------------------Identity--------------------------------------- //------------------------------Identity---------------------------------------
// Clearing a zero length array does nothing // Clearing a zero length array does nothing
Node *ClearArrayNode::Identity( PhaseTransform *phase ) { Node *ClearArrayNode::Identity( PhaseTransform *phase ) {
return phase->type(in(2))->higher_equal(TypeInt::ZERO) ? in(1) : this; return phase->type(in(2))->higher_equal(TypeX::ZERO) ? in(1) : this;
} }
//------------------------------Idealize--------------------------------------- //------------------------------Idealize---------------------------------------
...@@ -1954,6 +1954,11 @@ Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest, ...@@ -1954,6 +1954,11 @@ Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest,
Node* start_offset, Node* start_offset,
Node* end_offset, Node* end_offset,
PhaseGVN* phase) { PhaseGVN* phase) {
if (start_offset == end_offset) {
// nothing to do
return mem;
}
Compile* C = phase->C; Compile* C = phase->C;
int unit = BytesPerLong; int unit = BytesPerLong;
Node* zbase = start_offset; Node* zbase = start_offset;
...@@ -1979,6 +1984,11 @@ Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest, ...@@ -1979,6 +1984,11 @@ Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest,
intptr_t start_offset, intptr_t start_offset,
intptr_t end_offset, intptr_t end_offset,
PhaseGVN* phase) { PhaseGVN* phase) {
if (start_offset == end_offset) {
// nothing to do
return mem;
}
Compile* C = phase->C; Compile* C = phase->C;
assert((end_offset % BytesPerInt) == 0, "odd end offset"); assert((end_offset % BytesPerInt) == 0, "odd end offset");
intptr_t done_offset = end_offset; intptr_t done_offset = end_offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册