On Wed, 6 Jan 2021 13:24:22 GMT, Hao Sun <github.com+16932759+shqk...@openjdk.org> wrote:
>> @vnkozlov I was wondering if you could take a look at this? We're not sure >> whether 'operator=' is problematic or not. Thanks. > > I manually checked the usages of assignment operators for class DUIterator, > DUIterator_Fast and DUIterator_Last. (Simply grep the class names in the > source code and check the context). > > ~~I found there exist only a couple of re-assignment usages. However, I guess > kind of reset operations are conducted in these sites, and I suspect the > implementation of `operator=` might be good.~~ > > As I examined, only the following 3 sites are found where re-assignment > happens > https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/cfgnode.cpp#L565 > https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/phaseX.cpp#L1878 > https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/split_if.cpp#L452 > > Please take `cfgnode.cpp` as an example. `j` is first assigned at line 568 > and it would be assigned again if flag `progress` is true. ~~However, I > suppose `j` gets reset at line 578 in such case.~~ Note that `j` might be > re-assigned at line 578. However, it's self assignment and nothing is > conducted. > > ~~It might be incorrect if I missed something.~~ > Hope that this finding would be helpful to analyze this problem. Code is correct. _last should not be updated with additional assignments which updates only node's information. ------------- PR: https://git.openjdk.java.net/jdk/pull/1874