<div dir="ltr"><div dir="ltr"><div>Hi Doug,<br><br></div>Thanks for the additional information.</div><div dir="ltr"><br></div><div dir="ltr"><div>Given there are indeed no other JVMCI consumers other than Graal (at least known to us) I see how it might not be worth maintaining as a generic API and making it Graal-specific would make things easier.<br></div><div><br></div><div>Foivos<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 20, 2023 at 3:02 PM Douglas Simon <<a href="mailto:doug.simon@oracle.com" target="_blank">doug.simon@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Foivos,<br>
<br>
JVMCI is not a general API but has always been somewhat Graal specific. Project Galahad is demonstrating this strong coupling and taking the next logical step which is to move Graal into the JDK. At that point, we will strongly consider positioning JVMCI as JDK internal only.<br>
<br>
Note that projects such as Tornado VM rely on Graal, not just JVMCI. Without this proposed change, these projects would no longer work with OpenJDK. I would recommend that any project wanting to develop a Java based compiler for OpenJDK, follow the pattern of Tornado VM and build on Graal instead of JVMCI.<br>
<br>
-Doug<br>
<br>
> On 20 Oct 2023, at 10:59, Foivos Zakkak <<a href="mailto:fzakkak@redhat.com" target="_blank">fzakkak@redhat.com</a>> wrote:<br>
> <br>
> Hi Doug,<br>
> <br>
> On Thu, Oct 19, 2023 at 5:45 PM Douglas Simon <<a href="mailto:doug.simon@oracle.com" target="_blank">doug.simon@oracle.com</a>> wrote:<br>
> Adding <a href="mailto:galahad-dev@openjdk.org" target="_blank">galahad-dev@openjdk.org</a> <mailto:<a href="mailto:galahad-dev@openjdk.org" target="_blank">galahad-dev@openjdk.org</a>> to the thread.<br>
> <br>
> > On 19 Oct 2023, at 16:38, Douglas Simon <<a href="mailto:doug.simon@oracle.com" target="_blank">doug.simon@oracle.com</a>> wrote:<br>
> > <br>
> > Within the last year or so, the Graal team have been making large structural changes to the Graal code base to prepare for merging it into OpenJDK under Project Galahad. It’s important to make these structural changes prior to merging the sources into OpenJDK as they typically involve changes to a large number of files. For example, all code in the jdk.internal.vm.compiler module was consolidated into a single source directory using the standard OpenJDK layout[1]. The commit for this change alone had 3,481 changed files, 317 additions and 1,759 deletions.<br>
> > <br>
> > The above change could be made without any JDK changes. The next large change being undertaken is to rename the jdk.internal.vm.compiler module to jdk.compiler.graal[4]. Due to the way Java modules work, this does require a JDK change. The details are in <a href="https://bugs.openjdk.org/browse/JDK-8318027" rel="noreferrer" target="_blank">https://bugs.openjdk.org/browse/JDK-8318027</a> but the core of the issue is that the service[2] by which HotSpot can request a Graal compilation is defined in JVMCI and implemented by Graal. Since this service is in the boot layer, it can only be implemented by a provider in the boot layer. This export currently targets jdk.internal.vm.compiler[3] and so the binding will fail once the Graal module is renamed. That is, an export to jdk.compiler.graal is required.<br>
> > <br>
> <br>
> My concern is that this change means that moving forward any implementation of a compiler through JVMCI will have to provide the module jdk.compiler.graal instead of jdk.internal.vm.compiler. I am afraid this move is making JVMCI look Graal-specific which to my understanding was never the goal [1] despite its implementation being mostly Graal-driven in practice.<br>
> <br>
> Has this been considered?<br>
> <br>
> Thanks,<br>
> <br>
> [1] <a href="https://openjdk.org/jeps/243" rel="noreferrer" target="_blank">https://openjdk.org/jeps/243</a> <br>
> > The plan here is to replace the export to jdk.internal.vm.compiler with jdk.compiler.graal. This will allow OpenJDK binaries to keep working with the Graal code base post renaming. That is, it will allow the tip of Graal to continue working with the tip of OpenJDK, something that is important on the path to merging these 2 projects.<br>
> > <br>
> > Please leave feedback by replying to this email or with comments on <a href="https://github.com/openjdk/jdk/pull/16189" rel="noreferrer" target="_blank">https://github.com/openjdk/jdk/pull/16189</a><br>
> > <br>
> > -Doug<br>
> > <br>
> > [1] <a href="https://github.com/oracle/graal/commit/8be56121aa31e7448b4adb0224ab2ac44095ed9b" rel="noreferrer" target="_blank">https://github.com/oracle/graal/commit/8be56121aa31e7448b4adb0224ab2ac44095ed9b</a><br>
> > [2] <a href="https://github.com/openjdk/jdk/blob/56aa1e8dc8047cbc29d554889c64beb6eca0b8eb/src/jdk.internal.vm.ci/share/classes/module-info.java#L37" rel="noreferrer" target="_blank">https://github.com/openjdk/jdk/blob/56aa1e8dc8047cbc29d554889c64beb6eca0b8eb/src/jdk.internal.vm.ci/share/classes/module-info.java#L37</a><br>
> > [3] <a href="https://github.com/openjdk/jdk/blob/56aa1e8dc8047cbc29d554889c64beb6eca0b8eb/src/jdk.internal.vm.export" rel="noreferrer" target="_blank">https://github.com/openjdk/jdk/blob/56aa1e8dc8047cbc29d554889c64beb6eca0b8eb/src/jdk.internal.vm.export</a> to jdk.compiler.graalexport to jdk.compiler.graalci/share/classes/module-info.java#L28<br>
> > [4] <a href="https://github.com/oracle/graal/pull/7621" rel="noreferrer" target="_blank">https://github.com/oracle/graal/pull/7621</a><br>
> <br>
> <br>
> <br>
> <br>
> -- <br>
> Foivos Zakkak<br>
> Senior Software Engineer, R&D Product Middleware<br>
> Red Hat<br>
> 7B4069D929BAAE91C0B3220A0846BFD103F04EA1<br>
<br>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Foivos Zakkak<br>Senior Software Engineer, R&D Product Middleware<br>Red Hat<br>7B4069D929BAAE91C0B3220A0846BFD103F04EA1</div></div></div>