[lworld] RFR: 8326595: [lworld] Bootstrap VM transition to JEP 401 model

Tobias Hartmann thartmann at openjdk.org
Mon Feb 26 11:48:07 UTC 2024


On Thu, 22 Feb 2024 20:24:15 GMT, Frederic Parain <fparain at openjdk.org> wrote:

> Bootstrapping transition to JEP 401 model.
> A lot of things are broken, but at least the build works on most platforms, the VM can boot and execute some JEP 401 class files in interpreted mode. The ability to run code with value classes is still limited because the VM depends on some JDK core classes that need to be updated too (reflection and substitutability test).
> 
> Transition changes include:
>   - Accepting new class file format (not rejecting correct JEP 401 class files), changes class hierarchy rules, class flags meaning, changes verifier rules
>   - Update new and putfield bytecodes in interpreter to support new construction sequence
>   - Runtime tests fixes
> 
> Cleanup changes include:
>   - Removal of support of Q-descriptors (and Q-desc bit in constant pool)
>   - Removal of support of old class flags (ACC_VALUE)
>   - Removal of aconst_init and withfield bytecodes from the interpreter and C1
>   - Removal of support for secondary mirror
>   - Removal of support for primitive classes
>   - Removal of support for value factories (<vnew>)
>   - Partial removal of T_PRIMITIVE_OBJECT

src/hotspot/share/opto/graphKit.cpp line 3664:

> 3662: Node* GraphKit::is_val_mirror(Node* mirror) {
> 3663:   // JDK-8325660: notion of secondary mirror / val_mirror is gone one JEP 401
> 3664:   Node* p = basic_plus_adr(mirror, (int)0 /* java_lang_Class::secondary_mirror_offset() */);

This will break Escape Analysis because such an access with zero offset is unexpected:


# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/oracle/valhalla/open/src/hotspot/share/opto/escape.cpp:896), pid=600228, tid=600242
#  assert(_igvn->type(adr)->isa_rawptr()) failed: sanity
#
# JRE version: Java(TM) SE Runtime Environment (22.0) (fastdebug build 22-lworld4ea-2024-02-06-1232159.tobias...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 22-lworld4ea-2024-02-06-1232159.tobias..., compiled mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xbe2ec4]  ConnectionGraph::add_objload_to_connection_graph(Node*, Unique_Node_List*)+0x284


Please add this to disable the check properly:


diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp
index 92425fecf11..bd3ed61744b 100644
--- a/src/hotspot/share/opto/library_call.cpp
+++ b/src/hotspot/share/opto/library_call.cpp
@@ -4310,7 +4310,8 @@ bool LibraryCallKit::inline_native_subtype_check() {
     region->set_req(_both_ref_path, gen_subtype_check(subk, superk));
     // If superc is an inline mirror, we also need to check if superc == subc because LMyValue
     // is not a subtype of QMyValue but due to subk == superk the subtype check will pass.
-    generate_fair_guard(is_val_mirror(args[0]), prim_region);
+    // TODO JDK-8325660
+    // generate_fair_guard(is_val_mirror(args[0]), prim_region);
     // now we have a successful reference subtype check
     region->set_req(_ref_subtype_path, control());
   }

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1017#discussion_r1502485604



More information about the valhalla-dev mailing list