[lworld] RFR: 8327150: [lworld] Update C1 to support new value construction scheme from JEP 401
Tobias Hartmann
thartmann at openjdk.org
Mon Mar 4 13:39:59 UTC 2024
On Fri, 1 Mar 2024 20:57:08 GMT, Frederic Parain <fparain at openjdk.org> wrote:
> Fix value creation in C1, remove the old special node for value creation and out everything under the NewInstance node.
> There's also a fix in can_be_inline_klass() method that was causing a wrong behavior for acmp.
Thanks for working on this, Fred! Do all compiler tests now pass with `-XX:TieredStopAtLevel=3` or is there some work left?
src/hotspot/share/c1/c1_Compiler.cpp line 260:
> 258: if (PrintCFGToFile) { // borrowing flag for JDK build
> 259: tty->print_cr("Starting C1 compilation of %s.%s", method->holder()->name()->as_utf8(), method->name()->as_utf8());
> 260: }
Why do you need this?
src/hotspot/share/c1/c1_Instruction.hpp line 2068:
> 2066: // FIXME: Removal of NewInlineTypeInstance instruction makes those assert hard to write
> 2067: // assert(x->as_NewInlineTypeInstance() == nullptr || y->type() == objectNull, "Sanity check");
> 2068: // assert(y->as_NewInlineTypeInstance() == nullptr || x->type() == objectNull, "Sanity check");
Let's remove these checks for now.
src/hotspot/share/c1/c1_Runtime1.cpp line 373:
> 371: h->initialize(CHECK);
> 372: oop obj = nullptr;
> 373: if(h->is_empty_inline_type()) {
Suggestion:
if (h->is_empty_inline_type()) {
src/hotspot/share/c1/c1_Runtime1.cpp line 374:
> 372: oop obj = nullptr;
> 373: if(h->is_empty_inline_type()) {
> 374: assert(h->is_inline_klass(), "Sanity check");
Below `InlineKlass::cast` will already assert that.
src/hotspot/share/c1/c1_Runtime1.cpp line 375:
> 373: if(h->is_empty_inline_type()) {
> 374: assert(h->is_inline_klass(), "Sanity check");
> 375: assert(InlineKlass::cast(h)->default_value() != nullptr, "");
This can be moved below and check `obj != nullptr` directly.
-------------
PR Review: https://git.openjdk.org/valhalla/pull/1029#pullrequestreview-1914324112
PR Review Comment: https://git.openjdk.org/valhalla/pull/1029#discussion_r1511173608
PR Review Comment: https://git.openjdk.org/valhalla/pull/1029#discussion_r1511173264
PR Review Comment: https://git.openjdk.org/valhalla/pull/1029#discussion_r1511169072
PR Review Comment: https://git.openjdk.org/valhalla/pull/1029#discussion_r1511170599
PR Review Comment: https://git.openjdk.org/valhalla/pull/1029#discussion_r1511171181
More information about the valhalla-dev
mailing list