RFR: 8260338: Some fields in HaltNode is not cloned

Yasumasa Suenaga ysuenaga at openjdk.java.net
Mon Jan 25 06:34:41 UTC 2021


On Mon, 25 Jan 2021 06:22:49 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> I got strange log as following. Contents in `CodeString` is garbled. It seems not to be initialized.
>> 
>> [3.155s][trace][codestrings ] Created CodeString [ dエ・] (0x7f3804a150)
>> 
>> `HaltNode` has two fields - `_reachable` and `_halt_reason`, but they would not be cloned at Node::clone.
>
> 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.

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

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


More information about the hotspot-compiler-dev mailing list