Mercurial > hg > truffle
comparison src/share/vm/opto/memnode.cpp @ 68:daf38130e60d
6676841: ClearArrayNode::Identity is incorrect for 64-bit
Summary: ClearArrayNode::Identity should use TypeX instead of TypeInt
Reviewed-by: jrose, kvn, sgoldman
author | never |
---|---|
date | Tue, 18 Mar 2008 23:44:46 -0700 |
parents | b8f5ba577b02 |
children | 2a9af0b9cb1c |
comparison
equal
deleted
inserted
replaced
67:16e1cb7cde24 | 68:daf38130e60d |
---|---|
1879 } | 1879 } |
1880 | 1880 |
1881 //------------------------------Identity--------------------------------------- | 1881 //------------------------------Identity--------------------------------------- |
1882 // Clearing a zero length array does nothing | 1882 // Clearing a zero length array does nothing |
1883 Node *ClearArrayNode::Identity( PhaseTransform *phase ) { | 1883 Node *ClearArrayNode::Identity( PhaseTransform *phase ) { |
1884 return phase->type(in(2))->higher_equal(TypeInt::ZERO) ? in(1) : this; | 1884 return phase->type(in(2))->higher_equal(TypeX::ZERO) ? in(1) : this; |
1885 } | 1885 } |
1886 | 1886 |
1887 //------------------------------Idealize--------------------------------------- | 1887 //------------------------------Idealize--------------------------------------- |
1888 // Clearing a short array is faster with stores | 1888 // Clearing a short array is faster with stores |
1889 Node *ClearArrayNode::Ideal(PhaseGVN *phase, bool can_reshape){ | 1889 Node *ClearArrayNode::Ideal(PhaseGVN *phase, bool can_reshape){ |
1952 | 1952 |
1953 Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest, | 1953 Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest, |
1954 Node* start_offset, | 1954 Node* start_offset, |
1955 Node* end_offset, | 1955 Node* end_offset, |
1956 PhaseGVN* phase) { | 1956 PhaseGVN* phase) { |
1957 if (start_offset == end_offset) { | |
1958 // nothing to do | |
1959 return mem; | |
1960 } | |
1961 | |
1957 Compile* C = phase->C; | 1962 Compile* C = phase->C; |
1958 int unit = BytesPerLong; | 1963 int unit = BytesPerLong; |
1959 Node* zbase = start_offset; | 1964 Node* zbase = start_offset; |
1960 Node* zend = end_offset; | 1965 Node* zend = end_offset; |
1961 | 1966 |
1977 | 1982 |
1978 Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest, | 1983 Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest, |
1979 intptr_t start_offset, | 1984 intptr_t start_offset, |
1980 intptr_t end_offset, | 1985 intptr_t end_offset, |
1981 PhaseGVN* phase) { | 1986 PhaseGVN* phase) { |
1987 if (start_offset == end_offset) { | |
1988 // nothing to do | |
1989 return mem; | |
1990 } | |
1991 | |
1982 Compile* C = phase->C; | 1992 Compile* C = phase->C; |
1983 assert((end_offset % BytesPerInt) == 0, "odd end offset"); | 1993 assert((end_offset % BytesPerInt) == 0, "odd end offset"); |
1984 intptr_t done_offset = end_offset; | 1994 intptr_t done_offset = end_offset; |
1985 if ((done_offset % BytesPerLong) != 0) { | 1995 if ((done_offset % BytesPerLong) != 0) { |
1986 done_offset -= BytesPerInt; | 1996 done_offset -= BytesPerInt; |