[lworld] RFR: 8264897: [lworld] C2: Use BarrierSetC2::obj_allocate to buffer inline type in PhaseMacroExpand::expand_mh_intrinsic_return

Tobias Hartmann thartmann at openjdk.java.net
Fri Apr 16 06:37:59 UTC 2021


On Thu, 15 Apr 2021 02:55:25 GMT, Yi Yang <yyang at openjdk.org> wrote:

> Try to reuse existing BarrierSetC2::obj_allocate functionality for PhaseMacroExpand::expand_mh_intrinsic_return.
> 
> Testing: x86_64 + linux+ slowdebug/release
> [x] test/hotspot/jtreg/runtime/valhalla 
> [x] test/hotspot/jtreg/compiler/valhalla 
> 
> Thanks,
> Yang

Nice cleanup! I've added some minor comments, otherwise looks good to me.

src/hotspot/share/opto/macro.cpp line 2745:

> 2743: 
> 2744:   // Try to allocate a new buffered inline instance either from TLAB or eden space
> 2745:   Node* needgc_ctrl; // needgc means slowcase, i.e. allocation failed

Should be initialized to `NULL`.

src/hotspot/share/opto/macro.cpp line 2824:

> 2822:     if (domain->field_at(i) == Type::HALF) {
> 2823:       slow_call->init_req(i, top());
> 2824:       if (alloc_in_place) handler_call->init_req(i+1, top());

Please use parentheses for the if body. Same below.

src/hotspot/share/opto/macro.cpp line 2838:

> 2836:   Node* fast_ctl;
> 2837:   Node* fast_res;
> 2838:   MergeMemNode* fast_mem;

Should be initialized to `NULL`.

src/hotspot/share/opto/macro.cpp line 2848:

> 2846:   }
> 2847: 
> 2848:   Node* r = new RegionNode(alloc_in_place ? 4: 3);

Whitespace missing, should be `? 4 : 3`

src/hotspot/share/opto/macro.cpp line 3239:

> 3237:     case Node::Class_FlatArrayCheck:
> 3238:       expand_flatarraycheck_node(n->as_FlatArrayCheck());
> 3239:       assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");

Why did you delete these asserts?

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

Marked as reviewed by thartmann (Committer).

PR: https://git.openjdk.java.net/valhalla/pull/385



More information about the valhalla-dev mailing list