Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream vm-23.1.5 tag #41

Open
wants to merge 597 commits into
base: master
Choose a base branch
from

Conversation

zakkak
Copy link
Contributor

@zakkak zakkak commented Jan 23, 2025

While setting up the https://github.com/graalvm/graalvm-community-jdk21u repository and figuring out the details of how to maintain community backports, the GraalVM team pushed the vm-23.1.4 and vm-23.1.5 tags in the https://github.com/oracle/graal/ repository. These tags include changes not yet merged in the https://github.com/graalvm/graalvm-community-jdk21u repository whose vm-23.1.5 deviates from that of the https://github.com/oracle/graal/ repository.

This merge aims to bring in all the changes from the upstream vm-23.1.5 reducing the differences between the Oracle GraalVM 23.1 releases and the community ones.

The merge applied cleanly except for a few cases that were trivial to resolve (click to expand).

Merge conflicts related to version mismatch

Resolved by rejecting theirs / vm-23.1.5 changes

diff --cc compiler/mx.compiler/suite.py
index 0ca887ab017,654d7924de0..00000000000
--- a/compiler/mx.compiler/suite.py
+++ b/compiler/mx.compiler/suite.py
@@@ -4,8 -4,8 +4,13 @@@ suite =
    "sourceinprojectwhitelist" : [],

    "groupId" : "org.graalvm.compiler",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "url" : "http://www.graalvm.org/",
    "developer" : {
      "name" : "GraalVM Development",
diff --cc espresso/mx.espresso/suite.py
index 9c4ec91c403,7ee01415fa7..00000000000
--- a/espresso/mx.espresso/suite.py
+++ b/espresso/mx.espresso/suite.py
@@@ -23,8 -23,8 +23,13 @@@
  suite = {
      "mxversion": "6.44.0",
      "name": "espresso",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
 +    "release" : False,
++=======
+     "version" : "23.1.5",
+     "release" : True,
++>>>>>>> vm-23.1.5
      "groupId" : "org.graalvm.espresso",
      "url" : "https://www.graalvm.org/reference-manual/java-on-truffle/",
      "developer" : {
diff --cc regex/mx.regex/suite.py
index e9c249e8b92,866154707c6..00000000000
--- a/regex/mx.regex/suite.py
+++ b/regex/mx.regex/suite.py
@@@ -43,8 -43,8 +43,13 @@@ suite =

    "name" : "regex",

++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "groupId" : "org.graalvm.regex",
    "url" : "http://www.graalvm.org/",
    "developer" : {
diff --cc sdk/mx.sdk/suite.py
index a0432812f87,1cad3a2e0da..00000000000
--- a/sdk/mx.sdk/suite.py
+++ b/sdk/mx.sdk/suite.py
@@@ -41,8 -41,8 +41,13 @@@
  suite = {
    "mxversion": "6.39.0",
    "name" : "sdk",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "sourceinprojectwhitelist" : [],
    "url" : "https://github.com/oracle/graal",
    "groupId" : "org.graalvm.sdk",
diff --cc substratevm/mx.substratevm/suite.py
index 3920dc592f8,860c641d5d3..00000000000
--- a/substratevm/mx.substratevm/suite.py
+++ b/substratevm/mx.substratevm/suite.py
@@@ -2,8 -2,8 +2,13 @@@
  suite = {
      "mxversion": "6.27.1",
      "name": "substratevm",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
 +    "release" : False,
++=======
+     "version" : "23.1.5",
+     "release" : True,
++>>>>>>> vm-23.1.5
      "url" : "https://github.com/oracle/graal/tree/master/substratevm",

      "groupId" : "org.graalvm.nativeimage",
diff --cc tools/mx.tools/suite.py
index 1ac09483163,387787a5a96..00000000000
--- a/tools/mx.tools/suite.py
+++ b/tools/mx.tools/suite.py
@@@ -26,8 -26,8 +26,13 @@@ suite =
      "defaultLicense" : "GPLv2-CPE",

      "groupId" : "org.graalvm.tools",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
 +    "release" : False,
++=======
+     "version" : "23.1.5",
+     "release" : True,
++>>>>>>> vm-23.1.5
      "url" : "http://openjdk.java.net/projects/graal",
      "developer" : {
          "name" : "GraalVM Development",
diff --cc truffle/mx.truffle/suite.py
index 110aaa6ba46,229c02e4aa8..00000000000
--- a/truffle/mx.truffle/suite.py
+++ b/truffle/mx.truffle/suite.py
@@@ -41,8 -41,8 +41,13 @@@
  suite = {
    "mxversion": "6.39.0",
    "name" : "truffle",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "groupId" : "org.graalvm.truffle",
    "sourceinprojectwhitelist" : [],
    "url" : "http://openjdk.java.net/projects/graal",
diff --cc vm/mx.vm/suite.py
index 3913eaf82a7,4675e2f2294..00000000000
--- a/vm/mx.vm/suite.py
+++ b/vm/mx.vm/suite.py
@@@ -1,8 -1,8 +1,12 @@@
  suite = {
      "name": "vm",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
++=======
+     "version" : "23.1.5",
++>>>>>>> vm-23.1.5
      "mxversion": "6.41.0",
 -    "release" : True,
 +    "release" : False,
      "groupId" : "org.graalvm",

      "url" : "http://www.graalvm.org/",
diff --cc wasm/mx.wasm/suite.py
index 49728a1cd86,dc771366f8d..00000000000
--- a/wasm/mx.wasm/suite.py
+++ b/wasm/mx.wasm/suite.py
@@@ -42,7 -42,7 +42,11 @@@ suite =
    "mxversion": "6.41.0",
    "name" : "wasm",
    "groupId" : "org.graalvm.wasm",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
++=======
+   "version" : "23.1.5",
++>>>>>>> vm-23.1.5
    "versionConflictResolution" : "latest",
    "url" : "http://graalvm.org/",
    "developer" : {

Merge conflict related to #23 not removing deprecated methods in contrast to the upstream patch

Resolved by rejecting theirs / vm-23.1.5 changes as this was deemed safer.

diff --cc substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
index 323feb31e89,310f25d43b0..00000000000
--- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
+++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
@@@ -36,35 -36,6 +36,38 @@@ public interface ResourcesRegistry exte
      @SuppressWarnings("unchecked")
      static ResourcesRegistry singleton() {
          return ImageSingletons.lookup(ResourcesRegistry.class);
++<<<<<<< HEAD
 +    }
 +
 +    /**
 +     * @deprecated Use {@link RuntimeResourceSupport#addResources(ConfigurationCondition, String)}
 +     *             instead.
 +     */
 +    @Deprecated
 +    default void addResources(String pattern) {
 +        addResources(ConfigurationCondition.alwaysTrue(), pattern);
 +    }
 +
 +    /**
 +     * @deprecated Use
 +     *             {@link RuntimeResourceSupport#ignoreResources(ConfigurationCondition, String)}
 +     *             instead.
 +     */
 +    @Deprecated
 +    default void ignoreResources(String pattern) {
 +        ignoreResources(ConfigurationCondition.alwaysTrue(), pattern);
 +    }
 +
 +    /**
 +     * @deprecated Use
 +     *             {@link RuntimeResourceSupport#addResourceBundles(ConfigurationCondition, String)}
 +     *             instead.
 +     */
 +    @Deprecated
 +    default void addResourceBundles(String name) {
 +        addResourceBundles(ConfigurationCondition.alwaysTrue(), name);
++=======
++>>>>>>> vm-23.1.5
      }

      void addClassBasedResourceBundle(ConfigurationCondition condition, String basename, String className);

Merge conflict related to #4 in which aims to keep backwards compatibility with jdk versions < 21.0.4 while upstream does not

Resolved by rejecting theirs / vm-23.1.5 changes as backwards compatibility (with older CPU releases) is desirable and eases debugging with git bisect. Note, however, that I didn't check if any other upstream changes included in this PR break this kind of backwards compatibility.

diff --cc substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
index 6fe180ddb54,88717fa9901..00000000000
--- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
+++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
@@@ -57,20 -55,18 +57,33 @@@ public final class Target_java_lang_Vir
      // Checkstyle: stop
      @Alias static int NEW;
      @Alias static int STARTED;
++<<<<<<< HEAD
 +    @Alias //
 +    @TargetElement(onlyWith = JDK21u3OrEarlier.class) static int RUNNABLE;
++=======
++>>>>>>> vm-23.1.5
      @Alias static int RUNNING;
      @Alias static int PARKING;
      @Alias static int PARKED;
      @Alias static int PINNED;
      @Alias static int YIELDING;
++<<<<<<< HEAD
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int YIELDED;
 +    @Alias static int TERMINATED;
 +    @Alias static int SUSPENDED;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int TIMED_PARKING;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int TIMED_PARKED;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int TIMED_PINNED;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int UNPARKED;
++=======
+     @Alias static int YIELDED;
+     @Alias static int TERMINATED;
+     @Alias static int SUSPENDED;
+     @Alias static int TIMED_PARKING;
+     @Alias static int TIMED_PARKED;
+     @Alias static int TIMED_PINNED;
+     @Alias static int UNPARKED;
++>>>>>>> vm-23.1.5
      @Alias static Target_jdk_internal_vm_ContinuationScope VTHREAD_SCOPE;
      // Checkstyle: resume

@@@ -171,9 -167,7 +184,13 @@@
              } else {
                  return Thread.State.RUNNABLE;
              }
++<<<<<<< HEAD
 +        } else if (JDK21u3OrEarlier.jdk21u3OrEarlier && state == RUNNABLE) {
 +            return Thread.State.RUNNABLE;
 +        } else if (JDK21u4OrLater.jdk21u4OrLater && (state == UNPARKED || state == YIELDED)) {
++=======
+         } else if (state == UNPARKED || state == YIELDED) {
++>>>>>>> vm-23.1.5
              return Thread.State.RUNNABLE;
          } else if (state == RUNNING) {
              Object token = VirtualThreadHelper.acquireInterruptLockMaybeSwitch(this);
@@@ -201,12 -195,10 +218,19 @@@
              }
          } else if (state == TERMINATED) {
              return Thread.State.TERMINATED;
++<<<<<<< HEAD
 +        } else if (JDK21u4OrLater.jdk21u4OrLater) {
 +            if (state == TIMED_PARKING) {
 +                return Thread.State.RUNNABLE;
 +            } else if (state == TIMED_PARKED || state == TIMED_PINNED) {
 +                return Thread.State.TIMED_WAITING;
 +            }
++=======
+         } else if (state == TIMED_PARKING) {
+             return Thread.State.RUNNABLE;
+         } else if (state == TIMED_PARKED || state == TIMED_PINNED) {
+             return Thread.State.TIMED_WAITING;
++>>>>>>> vm-23.1.5
          }
          throw new InternalError();
      }

Merge conflict related to #23 not handling the sealed case while upstream does

Resolved by accepting theirs / vm-23.1.5 changes to catch the sealed case.

diff --cc substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
index 933700269ee,5c0580b05a3..00000000000
--- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
+++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
@@@ -1011,12 -1010,16 +1014,23 @@@ public class ReflectionDataBuilder exte

      @Override
      public void registerHeapReflectionField(Field reflectField, ScanReason reason) {
-         assert !sealed;
          AnalysisField analysisField = metaAccess.lookupJavaField(reflectField);
++<<<<<<< HEAD
 +        if (heapFields.put(analysisField, reflectField) == null && !SubstitutionReflectivityFilter.shouldExclude(reflectField, metaAccess, universe)) {
 +            registerTypesForField(analysisField, reflectField, false);
 +            if (analysisField.getDeclaringClass().isAnnotation()) {
 +                processAnnotationField(reflectField);
++=======
+         if (heapFields.put(analysisField, reflectField) == null) {
+             if (sealed) {
+                 throw new UnsupportedFeatureException("Registering new field for reflection when the image heap is already sealed: " + reflectField);
+             }
+             if (!SubstitutionReflectivityFilter.shouldExclude(reflectField, metaAccess, universe)) {
+                 registerTypesForField(analysisField, reflectField, false);
+                 if (analysisField.getDeclaringClass().isAnnotation()) {
+                     processAnnotationField(reflectField);
+                 }
++>>>>>>> vm-23.1.5
              }
          }
      }

Merge conflict due to different comment used in #2 and the corresponding upstream backport.

Accepted theirs / vm-23.1.5 to reduce differences.

diff --cc substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
index 73b95ece753,2fd9d6fb47b..00000000000
--- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
+++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
@@@ -200,14 -200,8 +201,19 @@@ class JfrTestFeature implements Featur
      }

      @Override
++<<<<<<< HEAD
 +    public void beforeAnalysis(BeforeAnalysisAccess access) {
 +        /*
 +         * Register proxies for event data assertion
 +         *
 +         * Unsigned added to be able to query RecordedObject.getLong() method, and this method
 +         * checks if the value returned has the jdk.jfr.Unsigned. The jfr layer in HotSpot creates a
 +         * proxy to query this information.
 +         */
++=======
+     public void beforeAnalysis(Feature.BeforeAnalysisAccess access) {
+         /* Needed so that the tests can call RecordedObject.getLong(). */
++>>>>>>> vm-23.1.5
          RuntimeProxyCreation.register(Unsigned.class);
      }
  }

Due to the large number of commits it's not trivial to list all the upstream issues being backported through this merge.

Supersedes #38

cc @simonis

woess and others added 30 commits June 28, 2024 16:51
(cherry picked from commit 1f826d9)
…ts, and benchmarks.

(cherry picked from commit b48dfe0)
(cherry picked from commit 950b8f3)
(cherry picked from commit 64b3170)
(cherry picked from commit 6b00d52)
(cherry picked from commit 117cde0)
(cherry picked from commit 75eb614)
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jan 23, 2025
@zakkak zakkak added this to the 23.1.7 milestone Jan 23, 2025
@zakkak zakkak linked an issue Jan 23, 2025 that may be closed by this pull request
While setting up the https://github.com/graalvm/graalvm-community-jdk21u
repository and figuring out the details of how to maintain community
backports, the GraalVM team pushed the `vm-23.1.4` and `vm-23.1.5` tags
in the https://github.com/oracle/graal/ repository. These tags include
changes not yet merged in the
https://github.com/graalvm/graalvm-community-jdk21u repository whose
`vm-23.1.5` deviates from that of the https://github.com/oracle/graal/
repository.

This merge aims to bring in all the changes from the upstream
`vm-23.1.5` reducing the differences between the Oracle GraalVM 23.1
releases and the community ones.

The merge applied cleanly except for a few cases that were trivial to
resolve. Two of them were related to
graalvm#23. One was
related to graalvm#4
supporting jdk versions < 21.0.4 while upstream does not. And the last
one was related to the comment in
graalvm#23.
@zakkak zakkak force-pushed the 2025-01-23-sync-with-upstream-vm-23.1.5 branch from f4b7252 to 1d52391 Compare January 23, 2025 13:31
@jerboaa
Copy link
Contributor

jerboaa commented Jan 23, 2025

There are some CI issues that need to be resolved.

@jerboaa
Copy link
Contributor

jerboaa commented Jan 27, 2025

IT main fails a test that's not supposed to be run with 23.1.6 (GraalVM CE 21.0.6). We perhaps we need an update there.

@Karm
Copy link
Contributor

Karm commented Jan 27, 2025

IT main fails a test that's not supposed to be run with 23.1.6 (GraalVM CE 21.0.6). We perhaps we need an update there.

https://github.com/quarkusio/quarkus/blob/main/integration-tests/main/src/test/java/io/quarkus/it/main/RegisterForReflectionITCase.java

 Error:  Failures: 
Error:  io.quarkus.it.main.RegisterForReflectionITCase.testLambdaCapturingPre23_1_3
Error:    Run 1: RegisterForReflectionITCase.testLambdaCapturingPre23_1_3:66 1 expectation failed.
Response body doesn't match expectation.
Expected: a string starting with "Comparator$$Lambda$"
  Actual: Comparator$$Lambda/0xc7facabea7d185476e9e1cd9e01e009cda293ae10

Error:    Run 2: RegisterForReflectionITCase.testLambdaCapturingPre23_1_3:66 1 expectation failed.
Response body doesn't match expectation.
Expected: a string starting with "Comparator$$Lambda$"
  Actual: Comparator$$Lambda/0xc7facabea7d185476e9e1cd9e01e009cda293ae10

Error:    Run 3: RegisterForReflectionITCase.testLambdaCapturingPre23_1_3:66 1 expectation failed.
Response body doesn't match expectation.
Expected: a string starting with "Comparator$$Lambda$"
  Actual: Comparator$$Lambda/0xc7facabea7d185476e9e1cd9e01e009cda293ae10

Error:    Run 4: RegisterForReflectionITCase.testLambdaCapturingPre23_1_3:66 1 expectation failed.
Response body doesn't match expectation.
Expected: a string starting with "Comparator$$Lambda$"
  Actual: Comparator$$Lambda/0xc7facabea7d185476e9e1cd9e01e009cda293ae10

@zakkak
Copy link
Contributor Author

zakkak commented Jan 27, 2025

Indeed, this is unrelated to the backport. I created quarkusio/quarkus#45873 to track it.

@bulasevich
Copy link

Hello.

Thank you for this impressive work!

It is difficult to review the PR. I wanted to ensure everything is included, but even that is not an easy task :)
Github shows only the most recent 250 commits out of 597. Same time on your branch I see 742 commits:

$ git checkout 2025-01-23-sync-with-upstream-vm-23.1.5
$ git merge-base 2025-01-23-sync-with-upstream-vm-23.1.5 master
53cf8c03139224d3d6316d862b37a208b2e31d01
$ git log --no-merges | grep -B9999 53cf8c03139224d3d6316d862b37a208b2e31d01 | grep ^commit | wc -l
742

With git log I noticed some duplicate commits on the branch, e.g.:

commit 9e2c6e7629eeb2a50550be6dea17ec81a2dd09ff
Author: Loic Ottet <loic.ottet@oracle.com>
Date:   Tue Aug 27 14:41:50 2024 +0200

    Adapt configuration parser to 23.1

commit ad0aec49921a5027ec5016077deffe33f6b902d5
Author: Loic Ottet <loic.ottet@oracle.com>
Date:   Tue Aug 27 14:41:50 2024 +0200

    Adapt configuration parser to 23.1

commit b3480b482a9686bf6f6a5075d95d7f2e5c226af6
Author: Robert Toyonaga <rtoyonag@redhat.com>
Date:   Mon Mar 25 16:43:34 2024 -0400

    Add correct values to GCHeapSummary

commit 32fb27d4d8d1d07d699cfdb44effcfee8597dba0
Author: Robert Toyonaga <rtoyonag@redhat.com>
Date:   Mon Mar 25 16:43:34 2024 -0400

    Add correct values to GCHeapSummary

commit 595cd903422c7b69a8432335467dccc3eace506b
Author: Loic Ottet <loic.ottet@oracle.com>
Date:   Thu Nov 30 11:35:47 2023 +0100

    Backport GR-50432: Allow fields to be registered for reflection without being made reachable

commit 4c94b473d47ef5019caf7ee70d1ae2f27edd2a8c
Author: Loic Ottet <loic.ottet@oracle.com>
Date:   Thu Nov 30 11:35:47 2023 +0100

    Backport GR-50432: Allow fields to be registered for reflection without being made reachable

commit b07ee163835148f79c172f5df456edb408cc6958
Author: Christian Haeubl <christian.haeubl@oracle.com>
Date:   Tue Jul 30 11:55:05 2024 +0200

    [GR-56816] Cleanups.

commit abb502cab422565d191b180e2ca871cdaa0f68d5
Author: Christian Haeubl <christian.haeubl@oracle.com>
Date:   Mon Jun 3 15:31:54 2024 +0200

    [GR-54582] Cleanups.

commit ab24a74e281e2f67b983c90245334cbdd4029d9c
Author: Tom Shull <tom.shull@oracle.com>
Date:   Thu Apr 25 13:10:23 2024 +0200

    Fix AArch64AtomicMove.

commit fce3895527a6ba745f36d90a4b2c0ac3ab33d353
Author: Tom Shull <tom.shull@oracle.com>
Date:   Thu Apr 25 13:10:23 2024 +0200

    Fix AArch64AtomicMove.

commit 59670c6bfdc525a7f93d21f753d97d64b22a58b4
Author: Peter Hofer <peter.hofer@oracle.com>
Date:   Fri Oct 6 19:19:22 2023 +0200

    [GR-48899] Support TIMED_WAITING for virtual threads.

commit a238da5d9abfbf1e643519501003bab053319b12
Author: Peter Hofer <peter.hofer@oracle.com>
Date:   Fri Oct 6 19:19:22 2023 +0200

    [GR-48899] Support TIMED_WAITING for virtual threads.

commit 9045610a308f82338667760345bab401cc6c30cd
Author: Christian Haeubl <christian.haeubl@oracle.com>
Date:   Wed Mar 27 11:23:56 2024 +0100

    Minor cleanups.

commit 5de7fa35e939edeb2b0200304cec1cecf67297a2
Author: Christian Haeubl <christian.haeubl@oracle.com>
Date:   Wed Mar 27 11:23:56 2024 +0100

    Minor cleanups.

commit 3a097bf0534c5d3471acbb3354404697a12283cb
Author: Loic Ottet <loic.ottet@oracle.com>
Date:   Tue Aug 27 14:36:49 2024 +0200

    Replace configuration parser with master version

commit d95b0863a199725f81ab3de32a15d17f54ebb74c
Author: Loic Ottet <loic.ottet@oracle.com>
Date:   Tue Aug 27 14:36:49 2024 +0200

    Replace configuration parser with master version

commit 3ff43b9ca23bbfdbdb5dcefd27dabc380eeda968
Author: Josef Eisl <josef.eisl@oracle.com>
Date:   Tue Sep 26 08:40:34 2023 +0200

    svm: adopt "JDK-8312498 Thread::getState and JVM TI GetThreadState should return TIMED_WAITING virtual thread is timed parked" [GR-48899]

commit a8262f8180fb6da1f8a3e6854b52964dd7cdf47a
Author: Josef Eisl <josef.eisl@oracle.com>
Date:   Tue Sep 26 08:40:34 2023 +0200

    svm: adopt "JDK-8312498 Thread::getState and JVM TI GetThreadState should return TIMED_WAITING virtual thread is timed parked" [GR-48899]

commit b19e7fde3754f277899482caefa2bc4fddd43226
Author: Josef Eisl <josef.eisl@oracle.com>
Date:   Sat Dec 9 15:50:52 2023 +0100

    svm: adopt "JDK-8321270: Virtual Thread.yield consumes parking permit" [GR-50851]

commit ab3336bd647a44329d6070f1eae19a625a709337
Author: Josef Eisl <josef.eisl@oracle.com>
Date:   Sat Dec 9 15:50:52 2023 +0100

    svm: adopt "JDK-8321270: Virtual Thread.yield consumes parking permit" [GR-50851]

Is this duplication expected? Will it land to master this way?

Thanks!

@zakkak
Copy link
Contributor Author

zakkak commented Jan 28, 2025

Thanks for the review @bulasevic.

It is difficult to review the PR.

I totally understand, any suggestions to make this easier are welcome. Perhaps we will need to split it in smaller ones.

Same time on your branch I see 742 commits

I believe this is due to the use of git merge-base. Interestingly, the commands you used return 0 on my machine

❯ git merge-base 2025-01-23-sync-with-upstream-vm-23.1.5 master
a2c7ca1c0abbc2b3fef247997ba05a31050c3f62
❯ git log --no-merges | grep -B9999 a2c7ca1c0abbc2b3fef247997ba05a31050c3f62 | grep ^commit | wc -l
0

and

❯ git log | grep -B9999 a2c7ca1c0abbc2b3fef247997ba05a31050c3f62 | grep ^commit | wc -l
3

(I suspect this has to do with some local configuration)

On the other hand, running:

❯ git rev-list 2025-01-23-sync-with-upstream-vm-23.1.5...master | wc -l

I am getting 597 as expected.

Is this duplication expected? Will it land to master this way?

Yes, the commits you mention have been backported individually and are already in master through:

@bulasevich
Copy link

That is interesting. Let us double-check the commit count. Using git rev-list, I found there are 941 commits in the range between 2025-01-23-sync-with-upstream-vm-23.1.5 and master:

$ git clone https://github.com/zakkak/graalvm-community-jdk21u.git graal-fz
$ cd graal-fz
$ git checkout 2025-01-23-sync-with-upstream-vm-23.1.5
$ git rev-list 2025-01-23-sync-with-upstream-vm-23.1.5...master | wc -l
941

@zakkak
Copy link
Contributor Author

zakkak commented Jan 28, 2025

@bulasevich can you please double check the commit hashes for both branches?

@bulasevich
Copy link

Perhaps we will need to split it in smaller ones.

Can I ask you how you are porting the changes? It's not a manual cherry-pick one by one, right?

Regarding the commits to be merged, I assume you're merging all of them, which seems fine.

If the commits are applied smoothly, then there may not be much to review. However, it would be helpful to see how any merge conflicts are resolved, as this is where mistakes are more likely to occur.

@zakkak
Copy link
Contributor Author

zakkak commented Jan 28, 2025

Can I ask you how you are porting the changes?

git merge vm-23.1.5

It's not a manual cherry-pick one by one, right?

Right, not even an automated one :)

Regarding the commits to be merged, I assume you're merging all of them, which seems fine.

Correct

If the commits are applied smoothly, then there may not be much to review. However, it would be helpful to see how any merge conflicts are resolved, as this is where mistakes are more likely to occur.

As mentioned in the description

The merge applied cleanly except for a few cases that were trivial to resolve. Two of them were related to https://github.com/graalvm/graalvm-community-jdk21u/pull/23. One was related to https://github.com/graalvm/graalvm-community-jdk21u/pull/4 supporting jdk versions < 21.0.4 while upstream does not. And the last one was related to the comment in https://github.com/graalvm/graalvm-community-jdk21u/pull/23.

not sure how I could provide more details about them, do you have any ideas?

@bulasevich
Copy link

I see different commit hashes for master

$ git clone https://github.com/zakkak/graalvm-community-jdk21u.git graal-fz
$ cd graal-fz
$ git checkout master
$ git log | head
commit 53cf8c03139224d3d6316d862b37a208b2e31d01
Author: Anas El korchi <anas.el.korchi@oracle.com>
Date:   Fri Jan 12 10:50:26 2024 +0100

Number of commits in between 2025-01-23-sync-with-upstream-vm-23.1.5 and a2c7ca1 is indeed 597:

$ git checkout 2025-01-23-sync-with-upstream-vm-23.1.5
$ git rev-list 2025-01-23-sync-with-upstream-vm-23.1.5...a2c7ca1 | wc -l
597

But a2c7ca1 is not a commit where 2025-01-23-sync-with-upstream-vm-23.1.5 diverted from master:

$ git merge-base master 2025-01-23-sync-with-upstream-vm-23.1.5
53cf8c03139224d3d6316d862b37a208b2e31d01
$ git rev-list 2025-01-23-sync-with-upstream-vm-23.1.5...53cf8c03 | wc -l
941

It seems there is an issue with my calculation, as the pull request message states: "zakkak wants to merge 597 commits into graalvm:master from zakkak:2025-01-23-sync-with-upstream-vm-23.1.5"

@zakkak
Copy link
Contributor Author

zakkak commented Jan 28, 2025

@bulasevich please use the master branch from this repository instead of the one from my fork, e.g.:

git clone https://github.com/graalvm/graalvm-community-jdk21u.git graal-fz
cd graal-fz
git remote add zakkak https://github.com/zakkak/graalvm-community-jdk21u.git
git show origin/master
git fetch zakkak
git show zakkak/2025-01-23-sync-with-upstream-vm-23.1.5

@bulasevich
Copy link

not sure how I could provide more details about them, do you have any ideas?

Just a thought - perhaps these changes could be put into separate PRs.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Jan 28, 2025
@bulasevich
Copy link

I think you did something like this

$ git clone https://github.com/zakkak/graalvm-community-jdk21u.git graalvm-fz ; cd graalvm-fz
$ git remote add oracle https://github.com/oracle/graal
$ git fetch oracle ; git fetch oracle --tags
$ git branch 2025-01-23-sync-with-upstream-vm-23.1.5 ; git checkout 2025-01-23-sync-with-upstream-vm-23.1.5
$ git merge vm-23.1.5

Here is the merge command output:

Auto-merging .github/workflows/main.yml
Auto-merging .github/workflows/quarkus.yml
Auto-merging compiler/mx.compiler/suite.py
CONFLICT (content): Merge conflict in compiler/mx.compiler/suite.py
Auto-merging espresso/mx.espresso/suite.py
CONFLICT (content): Merge conflict in espresso/mx.espresso/suite.py
Auto-merging regex/mx.regex/suite.py
CONFLICT (content): Merge conflict in regex/mx.regex/suite.py
Auto-merging sdk/mx.sdk/suite.py
CONFLICT (content): Merge conflict in sdk/mx.sdk/suite.py
Auto-merging substratevm/mx.substratevm/suite.py
CONFLICT (content): Merge conflict in substratevm/mx.substratevm/suite.py
Auto-merging substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourceConfigurationParser.java
Auto-merging substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
CONFLICT (content): Merge conflict in substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
Auto-merging substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/ReflectionConfigurationFilesHelp.txt
Auto-merging substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/doc-files/SerializationConfigurationFilesHelp.txt
Auto-merging substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
CONFLICT (content): Merge conflict in substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
Auto-merging substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ConditionalConfigurationRegistry.java
Auto-merging substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jni/JNIAccessFeature.java
Auto-merging substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/methodhandles/MethodHandleFeature.java
Auto-merging substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
CONFLICT (content): Merge conflict in substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
Auto-merging substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/serialize/SerializationFeature.java
Auto-merging substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
CONFLICT (content): Merge conflict in substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
Auto-merging tools/mx.tools/suite.py
CONFLICT (content): Merge conflict in tools/mx.tools/suite.py
Auto-merging truffle/mx.truffle/suite.py
CONFLICT (content): Merge conflict in truffle/mx.truffle/suite.py
Auto-merging truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/FileSystemsTest.java
Auto-merging vm/mx.vm/suite.py
CONFLICT (content): Merge conflict in vm/mx.vm/suite.py
Auto-merging wasm/mx.wasm/suite.py
CONFLICT (content): Merge conflict in wasm/mx.wasm/suite.py
Automatic merge failed; fix conflicts and then commit the result.

Here’s the conflict you resolved, and I agree - it’s quite straightforward.

diff --cc compiler/mx.compiler/suite.py
index 0ca887ab017,654d7924de0..00000000000
--- a/compiler/mx.compiler/suite.py
+++ b/compiler/mx.compiler/suite.py
@@@ -4,8 -4,8 +4,13 @@@ suite =
    "sourceinprojectwhitelist" : [],

    "groupId" : "org.graalvm.compiler",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "url" : "http://www.graalvm.org/",
    "developer" : {
      "name" : "GraalVM Development",
diff --cc espresso/mx.espresso/suite.py
index 9c4ec91c403,7ee01415fa7..00000000000
--- a/espresso/mx.espresso/suite.py
+++ b/espresso/mx.espresso/suite.py
@@@ -23,8 -23,8 +23,13 @@@
  suite = {
      "mxversion": "6.44.0",
      "name": "espresso",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
 +    "release" : False,
++=======
+     "version" : "23.1.5",
+     "release" : True,
++>>>>>>> vm-23.1.5
      "groupId" : "org.graalvm.espresso",
      "url" : "https://www.graalvm.org/reference-manual/java-on-truffle/",
      "developer" : {
diff --cc regex/mx.regex/suite.py
index e9c249e8b92,866154707c6..00000000000
--- a/regex/mx.regex/suite.py
+++ b/regex/mx.regex/suite.py
@@@ -43,8 -43,8 +43,13 @@@ suite =

    "name" : "regex",

++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "groupId" : "org.graalvm.regex",
    "url" : "http://www.graalvm.org/",
    "developer" : {
diff --cc sdk/mx.sdk/suite.py
index a0432812f87,1cad3a2e0da..00000000000
--- a/sdk/mx.sdk/suite.py
+++ b/sdk/mx.sdk/suite.py
@@@ -41,8 -41,8 +41,13 @@@
  suite = {
    "mxversion": "6.39.0",
    "name" : "sdk",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "sourceinprojectwhitelist" : [],
    "url" : "https://github.com/oracle/graal",
    "groupId" : "org.graalvm.sdk",
diff --cc substratevm/mx.substratevm/suite.py
index 3920dc592f8,860c641d5d3..00000000000
--- a/substratevm/mx.substratevm/suite.py
+++ b/substratevm/mx.substratevm/suite.py
@@@ -2,8 -2,8 +2,13 @@@
  suite = {
      "mxversion": "6.27.1",
      "name": "substratevm",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
 +    "release" : False,
++=======
+     "version" : "23.1.5",
+     "release" : True,
++>>>>>>> vm-23.1.5
      "url" : "https://github.com/oracle/graal/tree/master/substratevm",

      "groupId" : "org.graalvm.nativeimage",
diff --cc substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
index 323feb31e89,310f25d43b0..00000000000
--- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
+++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
@@@ -36,35 -36,6 +36,38 @@@ public interface ResourcesRegistry exte
      @SuppressWarnings("unchecked")
      static ResourcesRegistry singleton() {
          return ImageSingletons.lookup(ResourcesRegistry.class);
++<<<<<<< HEAD
 +    }
 +
 +    /**
 +     * @deprecated Use {@link RuntimeResourceSupport#addResources(ConfigurationCondition, String)}
 +     *             instead.
 +     */
 +    @Deprecated
 +    default void addResources(String pattern) {
 +        addResources(ConfigurationCondition.alwaysTrue(), pattern);
 +    }
 +
 +    /**
 +     * @deprecated Use
 +     *             {@link RuntimeResourceSupport#ignoreResources(ConfigurationCondition, String)}
 +     *             instead.
 +     */
 +    @Deprecated
 +    default void ignoreResources(String pattern) {
 +        ignoreResources(ConfigurationCondition.alwaysTrue(), pattern);
 +    }
 +
 +    /**
 +     * @deprecated Use
 +     *             {@link RuntimeResourceSupport#addResourceBundles(ConfigurationCondition, String)}
 +     *             instead.
 +     */
 +    @Deprecated
 +    default void addResourceBundles(String name) {
 +        addResourceBundles(ConfigurationCondition.alwaysTrue(), name);
++=======
++>>>>>>> vm-23.1.5
      }

      void addClassBasedResourceBundle(ConfigurationCondition condition, String basename, String className);
diff --cc substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
index 6fe180ddb54,88717fa9901..00000000000
--- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
+++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
@@@ -57,20 -55,18 +57,33 @@@ public final class Target_java_lang_Vir
      // Checkstyle: stop
      @Alias static int NEW;
      @Alias static int STARTED;
++<<<<<<< HEAD
 +    @Alias //
 +    @TargetElement(onlyWith = JDK21u3OrEarlier.class) static int RUNNABLE;
++=======
++>>>>>>> vm-23.1.5
      @Alias static int RUNNING;
      @Alias static int PARKING;
      @Alias static int PARKED;
      @Alias static int PINNED;
      @Alias static int YIELDING;
++<<<<<<< HEAD
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int YIELDED;
 +    @Alias static int TERMINATED;
 +    @Alias static int SUSPENDED;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int TIMED_PARKING;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int TIMED_PARKED;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int TIMED_PINNED;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int UNPARKED;
++=======
+     @Alias static int YIELDED;
+     @Alias static int TERMINATED;
+     @Alias static int SUSPENDED;
+     @Alias static int TIMED_PARKING;
+     @Alias static int TIMED_PARKED;
+     @Alias static int TIMED_PINNED;
+     @Alias static int UNPARKED;
++>>>>>>> vm-23.1.5
      @Alias static Target_jdk_internal_vm_ContinuationScope VTHREAD_SCOPE;
      // Checkstyle: resume

@@@ -171,9 -167,7 +184,13 @@@
              } else {
                  return Thread.State.RUNNABLE;
              }
++<<<<<<< HEAD
 +        } else if (JDK21u3OrEarlier.jdk21u3OrEarlier && state == RUNNABLE) {
 +            return Thread.State.RUNNABLE;
 +        } else if (JDK21u4OrLater.jdk21u4OrLater && (state == UNPARKED || state == YIELDED)) {
++=======
+         } else if (state == UNPARKED || state == YIELDED) {
++>>>>>>> vm-23.1.5
              return Thread.State.RUNNABLE;
          } else if (state == RUNNING) {
              Object token = VirtualThreadHelper.acquireInterruptLockMaybeSwitch(this);
@@@ -201,12 -195,10 +218,19 @@@
              }
          } else if (state == TERMINATED) {
              return Thread.State.TERMINATED;
++<<<<<<< HEAD
 +        } else if (JDK21u4OrLater.jdk21u4OrLater) {
 +            if (state == TIMED_PARKING) {
 +                return Thread.State.RUNNABLE;
 +            } else if (state == TIMED_PARKED || state == TIMED_PINNED) {
 +                return Thread.State.TIMED_WAITING;
 +            }
++=======
+         } else if (state == TIMED_PARKING) {
+             return Thread.State.RUNNABLE;
+         } else if (state == TIMED_PARKED || state == TIMED_PINNED) {
+             return Thread.State.TIMED_WAITING;
++>>>>>>> vm-23.1.5
          }
          throw new InternalError();
      }
diff --cc substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
index 933700269ee,5c0580b05a3..00000000000
--- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
+++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
@@@ -1011,12 -1010,16 +1014,23 @@@ public class ReflectionDataBuilder exte

      @Override
      public void registerHeapReflectionField(Field reflectField, ScanReason reason) {
-         assert !sealed;
          AnalysisField analysisField = metaAccess.lookupJavaField(reflectField);
++<<<<<<< HEAD
 +        if (heapFields.put(analysisField, reflectField) == null && !SubstitutionReflectivityFilter.shouldExclude(reflectField, metaAccess, universe)) {
 +            registerTypesForField(analysisField, reflectField, false);
 +            if (analysisField.getDeclaringClass().isAnnotation()) {
 +                processAnnotationField(reflectField);
++=======
+         if (heapFields.put(analysisField, reflectField) == null) {
+             if (sealed) {
+                 throw new UnsupportedFeatureException("Registering new field for reflection when the image heap is already sealed: " + reflectField);
+             }
+             if (!SubstitutionReflectivityFilter.shouldExclude(reflectField, metaAccess, universe)) {
+                 registerTypesForField(analysisField, reflectField, false);
+                 if (analysisField.getDeclaringClass().isAnnotation()) {
+                     processAnnotationField(reflectField);
+                 }
++>>>>>>> vm-23.1.5
              }
          }
      }
diff --cc substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
index 73b95ece753,2fd9d6fb47b..00000000000
--- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
+++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
@@@ -200,14 -200,8 +201,19 @@@ class JfrTestFeature implements Featur
      }

      @Override
++<<<<<<< HEAD
 +    public void beforeAnalysis(BeforeAnalysisAccess access) {
 +        /*
 +         * Register proxies for event data assertion
 +         *
 +         * Unsigned added to be able to query RecordedObject.getLong() method, and this method
 +         * checks if the value returned has the jdk.jfr.Unsigned. The jfr layer in HotSpot creates a
 +         * proxy to query this information.
 +         */
++=======
+     public void beforeAnalysis(Feature.BeforeAnalysisAccess access) {
+         /* Needed so that the tests can call RecordedObject.getLong(). */
++>>>>>>> vm-23.1.5
          RuntimeProxyCreation.register(Unsigned.class);
      }
  }
diff --cc tools/mx.tools/suite.py
index 1ac09483163,387787a5a96..00000000000
--- a/tools/mx.tools/suite.py
+++ b/tools/mx.tools/suite.py
@@@ -26,8 -26,8 +26,13 @@@ suite =
      "defaultLicense" : "GPLv2-CPE",

      "groupId" : "org.graalvm.tools",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
 +    "release" : False,
++=======
+     "version" : "23.1.5",
+     "release" : True,
++>>>>>>> vm-23.1.5
      "url" : "http://openjdk.java.net/projects/graal",
      "developer" : {
          "name" : "GraalVM Development",
diff --cc truffle/mx.truffle/suite.py
index 110aaa6ba46,229c02e4aa8..00000000000
--- a/truffle/mx.truffle/suite.py
+++ b/truffle/mx.truffle/suite.py
@@@ -41,8 -41,8 +41,13 @@@
  suite = {
    "mxversion": "6.39.0",
    "name" : "truffle",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "groupId" : "org.graalvm.truffle",
    "sourceinprojectwhitelist" : [],
    "url" : "http://openjdk.java.net/projects/graal",
diff --cc vm/mx.vm/suite.py
index 3913eaf82a7,4675e2f2294..00000000000
--- a/vm/mx.vm/suite.py
+++ b/vm/mx.vm/suite.py
@@@ -1,8 -1,8 +1,12 @@@
  suite = {
      "name": "vm",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
++=======
+     "version" : "23.1.5",
++>>>>>>> vm-23.1.5
      "mxversion": "6.41.0",
 -    "release" : True,
 +    "release" : False,
      "groupId" : "org.graalvm",

      "url" : "http://www.graalvm.org/",
diff --cc wasm/mx.wasm/suite.py
index 49728a1cd86,dc771366f8d..00000000000
--- a/wasm/mx.wasm/suite.py
+++ b/wasm/mx.wasm/suite.py
@@@ -42,7 -42,7 +42,11 @@@ suite =
    "mxversion": "6.41.0",
    "name" : "wasm",
    "groupId" : "org.graalvm.wasm",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
++=======
+   "version" : "23.1.5",
++>>>>>>> vm-23.1.5
    "versionConflictResolution" : "latest",
    "url" : "http://graalvm.org/",
    "developer" : {

I suggest annotating the diff (in the PR comments) with a brief note explaining why it occurred and which merge solution was applied. I think that should be sufficient.

Thank you!

@zakkak
Copy link
Contributor Author

zakkak commented Jan 29, 2025

I think you did something like this

Correct (in general I use a single local repository with multiple remotes and git-worktree's to manage everything GraalVM related.)

I suggest annotating the diff (in the PR comments) with a brief note explaining why it occurred and which merge solution was applied. I think that should be sufficient.

Sounds reasonable, see below.

Merge conflicts related to version mismatch

Resolved by rejecting theirs / vm-23.1.5 changes

diff --cc compiler/mx.compiler/suite.py
index 0ca887ab017,654d7924de0..00000000000
--- a/compiler/mx.compiler/suite.py
+++ b/compiler/mx.compiler/suite.py
@@@ -4,8 -4,8 +4,13 @@@ suite =
    "sourceinprojectwhitelist" : [],

    "groupId" : "org.graalvm.compiler",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "url" : "http://www.graalvm.org/",
    "developer" : {
      "name" : "GraalVM Development",
diff --cc espresso/mx.espresso/suite.py
index 9c4ec91c403,7ee01415fa7..00000000000
--- a/espresso/mx.espresso/suite.py
+++ b/espresso/mx.espresso/suite.py
@@@ -23,8 -23,8 +23,13 @@@
  suite = {
      "mxversion": "6.44.0",
      "name": "espresso",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
 +    "release" : False,
++=======
+     "version" : "23.1.5",
+     "release" : True,
++>>>>>>> vm-23.1.5
      "groupId" : "org.graalvm.espresso",
      "url" : "https://www.graalvm.org/reference-manual/java-on-truffle/",
      "developer" : {
diff --cc regex/mx.regex/suite.py
index e9c249e8b92,866154707c6..00000000000
--- a/regex/mx.regex/suite.py
+++ b/regex/mx.regex/suite.py
@@@ -43,8 -43,8 +43,13 @@@ suite =

    "name" : "regex",

++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "groupId" : "org.graalvm.regex",
    "url" : "http://www.graalvm.org/",
    "developer" : {
diff --cc sdk/mx.sdk/suite.py
index a0432812f87,1cad3a2e0da..00000000000
--- a/sdk/mx.sdk/suite.py
+++ b/sdk/mx.sdk/suite.py
@@@ -41,8 -41,8 +41,13 @@@
  suite = {
    "mxversion": "6.39.0",
    "name" : "sdk",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "sourceinprojectwhitelist" : [],
    "url" : "https://github.com/oracle/graal",
    "groupId" : "org.graalvm.sdk",
diff --cc substratevm/mx.substratevm/suite.py
index 3920dc592f8,860c641d5d3..00000000000
--- a/substratevm/mx.substratevm/suite.py
+++ b/substratevm/mx.substratevm/suite.py
@@@ -2,8 -2,8 +2,13 @@@
  suite = {
      "mxversion": "6.27.1",
      "name": "substratevm",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
 +    "release" : False,
++=======
+     "version" : "23.1.5",
+     "release" : True,
++>>>>>>> vm-23.1.5
      "url" : "https://github.com/oracle/graal/tree/master/substratevm",

      "groupId" : "org.graalvm.nativeimage",
diff --cc tools/mx.tools/suite.py
index 1ac09483163,387787a5a96..00000000000
--- a/tools/mx.tools/suite.py
+++ b/tools/mx.tools/suite.py
@@@ -26,8 -26,8 +26,13 @@@ suite =
      "defaultLicense" : "GPLv2-CPE",

      "groupId" : "org.graalvm.tools",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
 +    "release" : False,
++=======
+     "version" : "23.1.5",
+     "release" : True,
++>>>>>>> vm-23.1.5
      "url" : "http://openjdk.java.net/projects/graal",
      "developer" : {
          "name" : "GraalVM Development",
diff --cc truffle/mx.truffle/suite.py
index 110aaa6ba46,229c02e4aa8..00000000000
--- a/truffle/mx.truffle/suite.py
+++ b/truffle/mx.truffle/suite.py
@@@ -41,8 -41,8 +41,13 @@@
  suite = {
    "mxversion": "6.39.0",
    "name" : "truffle",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
 +  "release" : False,
++=======
+   "version" : "23.1.5",
+   "release" : True,
++>>>>>>> vm-23.1.5
    "groupId" : "org.graalvm.truffle",
    "sourceinprojectwhitelist" : [],
    "url" : "http://openjdk.java.net/projects/graal",
diff --cc vm/mx.vm/suite.py
index 3913eaf82a7,4675e2f2294..00000000000
--- a/vm/mx.vm/suite.py
+++ b/vm/mx.vm/suite.py
@@@ -1,8 -1,8 +1,12 @@@
  suite = {
      "name": "vm",
++<<<<<<< HEAD
 +    "version" : "23.1.7",
++=======
+     "version" : "23.1.5",
++>>>>>>> vm-23.1.5
      "mxversion": "6.41.0",
 -    "release" : True,
 +    "release" : False,
      "groupId" : "org.graalvm",

      "url" : "http://www.graalvm.org/",
diff --cc wasm/mx.wasm/suite.py
index 49728a1cd86,dc771366f8d..00000000000
--- a/wasm/mx.wasm/suite.py
+++ b/wasm/mx.wasm/suite.py
@@@ -42,7 -42,7 +42,11 @@@ suite =
    "mxversion": "6.41.0",
    "name" : "wasm",
    "groupId" : "org.graalvm.wasm",
++<<<<<<< HEAD
 +  "version" : "23.1.7",
++=======
+   "version" : "23.1.5",
++>>>>>>> vm-23.1.5
    "versionConflictResolution" : "latest",
    "url" : "http://graalvm.org/",
    "developer" : {

Merge conflict related to #23 not removing deprecated methods in contrast to the upstream patch

Resolved by rejecting theirs / vm-23.1.5 changes as this was deemed safer.

diff --cc substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
index 323feb31e89,310f25d43b0..00000000000
--- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
+++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java
@@@ -36,35 -36,6 +36,38 @@@ public interface ResourcesRegistry exte
      @SuppressWarnings("unchecked")
      static ResourcesRegistry singleton() {
          return ImageSingletons.lookup(ResourcesRegistry.class);
++<<<<<<< HEAD
 +    }
 +
 +    /**
 +     * @deprecated Use {@link RuntimeResourceSupport#addResources(ConfigurationCondition, String)}
 +     *             instead.
 +     */
 +    @Deprecated
 +    default void addResources(String pattern) {
 +        addResources(ConfigurationCondition.alwaysTrue(), pattern);
 +    }
 +
 +    /**
 +     * @deprecated Use
 +     *             {@link RuntimeResourceSupport#ignoreResources(ConfigurationCondition, String)}
 +     *             instead.
 +     */
 +    @Deprecated
 +    default void ignoreResources(String pattern) {
 +        ignoreResources(ConfigurationCondition.alwaysTrue(), pattern);
 +    }
 +
 +    /**
 +     * @deprecated Use
 +     *             {@link RuntimeResourceSupport#addResourceBundles(ConfigurationCondition, String)}
 +     *             instead.
 +     */
 +    @Deprecated
 +    default void addResourceBundles(String name) {
 +        addResourceBundles(ConfigurationCondition.alwaysTrue(), name);
++=======
++>>>>>>> vm-23.1.5
      }

      void addClassBasedResourceBundle(ConfigurationCondition condition, String basename, String className);

Merge conflict related to #4 in which aims to keep backwards compatibility with jdk versions < 21.0.4 while upstream does not

Resolved by rejecting theirs / vm-23.1.5 changes as backwards compatibility (with older CPU releases) is desirable and eases debugging with git bisect. Note, however, that I didn't check if any other upstream changes included in this PR break this kind of backwards compatibility.

diff --cc substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
index 6fe180ddb54,88717fa9901..00000000000
--- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
+++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java
@@@ -57,20 -55,18 +57,33 @@@ public final class Target_java_lang_Vir
      // Checkstyle: stop
      @Alias static int NEW;
      @Alias static int STARTED;
++<<<<<<< HEAD
 +    @Alias //
 +    @TargetElement(onlyWith = JDK21u3OrEarlier.class) static int RUNNABLE;
++=======
++>>>>>>> vm-23.1.5
      @Alias static int RUNNING;
      @Alias static int PARKING;
      @Alias static int PARKED;
      @Alias static int PINNED;
      @Alias static int YIELDING;
++<<<<<<< HEAD
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int YIELDED;
 +    @Alias static int TERMINATED;
 +    @Alias static int SUSPENDED;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int TIMED_PARKING;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int TIMED_PARKED;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int TIMED_PINNED;
 +    @TargetElement(onlyWith = JDK21u4OrLater.class) @Alias static int UNPARKED;
++=======
+     @Alias static int YIELDED;
+     @Alias static int TERMINATED;
+     @Alias static int SUSPENDED;
+     @Alias static int TIMED_PARKING;
+     @Alias static int TIMED_PARKED;
+     @Alias static int TIMED_PINNED;
+     @Alias static int UNPARKED;
++>>>>>>> vm-23.1.5
      @Alias static Target_jdk_internal_vm_ContinuationScope VTHREAD_SCOPE;
      // Checkstyle: resume

@@@ -171,9 -167,7 +184,13 @@@
              } else {
                  return Thread.State.RUNNABLE;
              }
++<<<<<<< HEAD
 +        } else if (JDK21u3OrEarlier.jdk21u3OrEarlier && state == RUNNABLE) {
 +            return Thread.State.RUNNABLE;
 +        } else if (JDK21u4OrLater.jdk21u4OrLater && (state == UNPARKED || state == YIELDED)) {
++=======
+         } else if (state == UNPARKED || state == YIELDED) {
++>>>>>>> vm-23.1.5
              return Thread.State.RUNNABLE;
          } else if (state == RUNNING) {
              Object token = VirtualThreadHelper.acquireInterruptLockMaybeSwitch(this);
@@@ -201,12 -195,10 +218,19 @@@
              }
          } else if (state == TERMINATED) {
              return Thread.State.TERMINATED;
++<<<<<<< HEAD
 +        } else if (JDK21u4OrLater.jdk21u4OrLater) {
 +            if (state == TIMED_PARKING) {
 +                return Thread.State.RUNNABLE;
 +            } else if (state == TIMED_PARKED || state == TIMED_PINNED) {
 +                return Thread.State.TIMED_WAITING;
 +            }
++=======
+         } else if (state == TIMED_PARKING) {
+             return Thread.State.RUNNABLE;
+         } else if (state == TIMED_PARKED || state == TIMED_PINNED) {
+             return Thread.State.TIMED_WAITING;
++>>>>>>> vm-23.1.5
          }
          throw new InternalError();
      }

Merge conflict related to #23 not handling the sealed case while upstream does

Resolved by accepting theirs / vm-23.1.5 changes to catch the sealed case.

diff --cc substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
index 933700269ee,5c0580b05a3..00000000000
--- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
+++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java
@@@ -1011,12 -1010,16 +1014,23 @@@ public class ReflectionDataBuilder exte

      @Override
      public void registerHeapReflectionField(Field reflectField, ScanReason reason) {
-         assert !sealed;
          AnalysisField analysisField = metaAccess.lookupJavaField(reflectField);
++<<<<<<< HEAD
 +        if (heapFields.put(analysisField, reflectField) == null && !SubstitutionReflectivityFilter.shouldExclude(reflectField, metaAccess, universe)) {
 +            registerTypesForField(analysisField, reflectField, false);
 +            if (analysisField.getDeclaringClass().isAnnotation()) {
 +                processAnnotationField(reflectField);
++=======
+         if (heapFields.put(analysisField, reflectField) == null) {
+             if (sealed) {
+                 throw new UnsupportedFeatureException("Registering new field for reflection when the image heap is already sealed: " + reflectField);
+             }
+             if (!SubstitutionReflectivityFilter.shouldExclude(reflectField, metaAccess, universe)) {
+                 registerTypesForField(analysisField, reflectField, false);
+                 if (analysisField.getDeclaringClass().isAnnotation()) {
+                     processAnnotationField(reflectField);
+                 }
++>>>>>>> vm-23.1.5
              }
          }
      }

Merge conflict due to different comment used in #2 and the corresponding upstream backport.

Accepted theirs / vm-23.1.5 to reduce differences.

diff --cc substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
index 73b95ece753,2fd9d6fb47b..00000000000
--- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
+++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java
@@@ -200,14 -200,8 +201,19 @@@ class JfrTestFeature implements Featur
      }

      @Override
++<<<<<<< HEAD
 +    public void beforeAnalysis(BeforeAnalysisAccess access) {
 +        /*
 +         * Register proxies for event data assertion
 +         *
 +         * Unsigned added to be able to query RecordedObject.getLong() method, and this method
 +         * checks if the value returned has the jdk.jfr.Unsigned. The jfr layer in HotSpot creates a
 +         * proxy to query this information.
 +         */
++=======
+     public void beforeAnalysis(Feature.BeforeAnalysisAccess access) {
+         /* Needed so that the tests can call RecordedObject.getLong(). */
++>>>>>>> vm-23.1.5
          RuntimeProxyCreation.register(Unsigned.class);
      }
  }

Update: I added this to the PR description as well

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. and removed OCA Verified All contributors have signed the Oracle Contributor Agreement. labels Jan 29, 2025
@bulasevich
Copy link

Looks good to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Backport] Changes from upstream Graal tag vm-23.1.5