From 490e0c732d787b539b7c53a04f80ecc429621251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereda?= Date: Sun, 8 Sep 2024 19:49:53 +0200 Subject: [PATCH] Fix jvmci warning and build native agent (#20) * Update GraalHotSpotVMConfig.java * Update gluon-build.yml * Update gluon-release.yml * Update gluon-build.yml * Update gluon-build.yml * Update gluon-release.yml * Update gluon-build.yml * Update gluon-build.yml * Update gluon-release.yml --- .github/workflows/gluon-build.yml | 20 +++++++++---------- .github/workflows/gluon-release.yml | 11 ++++------ .../hotspot/GraalHotSpotVMConfig.java | 2 +- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/gluon-build.yml b/.github/workflows/gluon-build.yml index d57bff91363f..17972167cdb8 100644 --- a/.github/workflows/gluon-build.yml +++ b/.github/workflows/gluon-build.yml @@ -5,10 +5,10 @@ name: Gluon Build on: push: branches: - - 'master' + - 'gluon24' pull_request: branches: - - 'master' + - 'gluon24' workflow_dispatch: env: @@ -40,7 +40,7 @@ jobs: LABS_HOME: ${{ github.workspace }}/jdk MX_PYTHON: python3.9 MX_PATH: ${{ github.workspace }}/mx - GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-24.1 + GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-23+25.1 DYNAMIC_IMPORTS: "/substratevm" DISABLE_POLYGLOT: true DISABLE_LIBPOLYGLOT: true @@ -70,17 +70,15 @@ jobs: tar -xf labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz echo "JAVA_HOME=${{ github.workspace }}/labsjdk-ce-23-jvmci-b01${{ matrix.HOME }}" >> ${GITHUB_ENV} - name: Build GraalVM - id: build-graalvm run: | cd substratevm - ${MX_PATH}/mx --dy /substratevm build - GRAALVM_HOME=`${MX_PATH}/mx --dy /substratevm graalvm-home` - echo "::set-output name=graalvm-home-dir::$GRAALVM_HOME" + ${MX_PATH}/mx --dy /substratevm --native-images=lib:native-image-agent build + echo "GRAALVM_HOME=`${MX_PATH}/mx --native-images=lib:native-image-agent graalvm-home`" >> ${GITHUB_ENV} cd .. - name: Create distribution working-directory: ./vm run: | - cd ${{ steps.build-graalvm.outputs.graalvm-home-dir }}/.. + cd ${{ env.GRAALVM_HOME }}/.. if [[ ${{ matrix.os }} != 'ubuntu-latest' ]] then cd ../.. @@ -112,7 +110,7 @@ jobs: LABS_HOME: ${{ github.workspace }}/jdk MX_PYTHON: 'python' MX_PATH: ${{ github.workspace }}/mx - GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-24.1 + GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-23+25.1 DYNAMIC_IMPORTS: "/substratevm" DISABLE_POLYGLOT: true DISABLE_LIBPOLYGLOT: true @@ -141,8 +139,8 @@ jobs: shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - call ${{ env.MX_PATH }}\mx.cmd -p substratevm build - call ${{ env.MX_PATH }}\mx.cmd -p substratevm graalvm-home > graalvm-home-with-forward-slashes.txt + call ${{ env.MX_PATH }}\mx.cmd -p substratevm --dy /substratevm --native-images=lib:native-image-agent build + call ${{ env.MX_PATH }}\mx.cmd -p substratevm --native-images=lib:native-image-agent graalvm-home > graalvm-home-with-forward-slashes.txt set /p GRAALVM_HOME=> ${GITHUB_ENV} - name: Build GraalVM - id: build-graalvm run: | cd substratevm - ${MX_PATH}/mx --dy /substratevm build - GRAALVM_HOME=`${MX_PATH}/mx --dy /substratevm graalvm-home` - echo "::set-output name=graalvm-home-dir::$GRAALVM_HOME" + ${MX_PATH}/mx --dy /substratevm --native-images=lib:native-image-agent build + echo "GRAALVM_HOME=`${MX_PATH}/mx --native-images=lib:native-image-agent graalvm-home`" >> ${GITHUB_ENV} cd .. - name: Create distribution working-directory: ./vm @@ -152,12 +150,11 @@ jobs: shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - call ${{ env.MX_PATH }}\mx.cmd -p substratevm build - call ${{ env.MX_PATH }}\mx.cmd -p substratevm graalvm-home > graalvm-home-with-forward-slashes.txt + call ${{ env.MX_PATH }}\mx.cmd -p substratevm --dy /substratevm --native-images=lib:native-image-agent build + call ${{ env.MX_PATH }}\mx.cmd -p substratevm --native-images=lib:native-image-agent graalvm-home > graalvm-home-with-forward-slashes.txt set /p GRAALVM_HOME=> %GITHUB_ENV% - name: Create distribution working-directory: ./vm diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java index e30152996023..3cb69eac72a3 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java @@ -397,7 +397,7 @@ public long defaultPrototypeMarkWord() { public final long verifyOopMask = getFieldValue("CompilerToVM::Data::Universe_verify_oop_mask", Long.class, "uintptr_t"); public final long verifyOopBits = getFieldValue("CompilerToVM::Data::Universe_verify_oop_bits", Long.class, "uintptr_t"); - public final int logOfHRGrainBytes = getFieldValue("HeapRegion::LogOfHRGrainBytes", Integer.class, JDK >= 22 ? "uint" : "int"); + public final int logOfHRGrainBytes = getFieldValue(JDK >= 23 ? "G1HeapRegion::LogOfHRGrainBytes" : "HeapRegion::LogOfHRGrainBytes", Integer.class, JDK >= 22 ? "uint" : "int"); public final int cardtableShift = getFieldValue("CompilerToVM::Data::cardtable_shift", Integer.class, "int"); public final long cardtableStartAddress = getFieldValue("CompilerToVM::Data::cardtable_start_address", Long.class, "CardTable::CardValue*");