RFR: 8260338: Some fields in HaltNode is not cloned

Xin Liu xliu at openjdk.java.net
Mon Jan 25 07:23:39 UTC 2021


On Mon, 25 Jan 2021 06:32:01 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:

>> src/hotspot/share/opto/node.cpp line 571:
>> 
>>> 569:     n->as_SafePoint()->clone_replaced_nodes();
>>> 570:   }
>>> 571:   if (n->is_Halt()) {
>> 
>> This line seems unnecessary. I see HaltNode::size() increases from 0x60 to 0x70 with your patch.  Memcpy at line 502 covers it, doesn't it?
>
> `_reachable` and `_halt_reason` are available on `HaltNode`, not `Node`,  so I think this condition is necessary.
> L502 uses the result of `Node::size_of()`, and I overrided it in `HaltNode`. So memory allocation at L501 and memcpy at L502 are safety.

size_of() is a virtual function.  line 500 should use HaltNode::size_of(), which give you 112(0x70) bytes, right?
I mean memcpy at line 502 should cover HaltNode's member variables.  
`Copy::conjoint_words_to_lower((HeapWord*)this, (HeapWord*)n, s);`

-------------

PR: https://git.openjdk.java.net/jdk/pull/2213


More information about the hotspot-compiler-dev mailing list