RFR: 8252583: Make PhiNode::is_copy() debug only [v2]

Xin Liu xliu at openjdk.java.net
Mon Sep 21 21:00:16 UTC 2020


On Mon, 21 Sep 2020 12:01:20 GMT, Roberto Castañeda Lozano <github.com+8792647+robcasloz at openjdk.org> wrote:

>> Convert `PhiNode::is_copy()` into an actual, debug-only predicate. Replace calls to `is_copy()` from non-debug code
>> with explicit assertions. Remove dead loop in debug-only `MergeMemStream::match_memory()`.
>
> Roberto Castañeda Lozano has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix spacing in touched lines

src/hotspot/share/opto/loopnode.cpp line 53:

> 51: bool Node::is_cloop_ind_var() const {
> 52: #ifdef ASSERT
> 53:   if (is_Phi()) assert(!as_Phi()->is_copy(), "this phi cannot be a copy");

This line doesn't seem right because `assert` is empty if NDEBUG is set.
it will alter the original c++ code.

better to put predicate in assert like Tobias said. `assert(!is_Phi() || !as_Phi()->is_copy() ...)`

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

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


More information about the hotspot-compiler-dev mailing list