diff --git a/.github/configs/base.yml b/.github/configs/base.yml index 133216fe..85837d0b 100644 --- a/.github/configs/base.yml +++ b/.github/configs/base.yml @@ -91,15 +91,6 @@ runtimes: release: 11 home: "/home/runner/work/mmtk-openjdk/mmtk-openjdk/bundles/jdk" -configs: - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-SemiSpace" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-GenCopy" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-Immix" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-GenImmix" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-StickyImmix" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-MarkSweep" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-MarkCompact" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-Compressor" - -benchmarks: - dacapo-23.9-RC3-chopin-ci: +# We don't include `configs` or `benchmarks` here. +# This file will be included by `large-heap.yml` and `normal-heap.yml` +# so that we can test different plans with different heap sizes. diff --git a/.github/configs/large-heap.yml b/.github/configs/large-heap.yml new file mode 100644 index 00000000..807f3c8c --- /dev/null +++ b/.github/configs/large-heap.yml @@ -0,0 +1,9 @@ +includes: + - "./base.yml" + +configs: + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-ConcurrentImmix" + +# This will be expanded in CI when we run with the config. Keep a new line at the end. +benchmarks: + dacapo-23.9-RC3-chopin-ci: diff --git a/.github/configs/normal-heap.yml b/.github/configs/normal-heap.yml new file mode 100644 index 00000000..43b7b9ee --- /dev/null +++ b/.github/configs/normal-heap.yml @@ -0,0 +1,16 @@ +includes: + - "./base.yml" + +configs: + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-SemiSpace" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-GenCopy" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-Immix" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-GenImmix" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-StickyImmix" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-MarkSweep" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-MarkCompact" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-Compressor" + +# This will be expanded in CI when we run with the config. Keep a new line at the end. +benchmarks: + dacapo-23.9-RC3-chopin-ci: diff --git a/.github/scripts/ci-expected-results.yml b/.github/scripts/ci-expected-results.yml index 1bbcc3e8..4d07d89d 100644 --- a/.github/scripts/ci-expected-results.yml +++ b/.github/scripts/ci-expected-results.yml @@ -10,6 +10,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass batik: SemiSpace: pass GenCopy: pass @@ -19,6 +20,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass biojava: SemiSpace: pass GenCopy: pass @@ -28,6 +30,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass cassandra: SemiSpace: pass GenCopy: pass @@ -37,6 +40,7 @@ results: MarkSweep: ignore MarkCompact: ignore Compressor: ignore + ConcurrentImmix: ignore eclipse: SemiSpace: pass GenCopy: pass @@ -46,6 +50,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass fop: SemiSpace: pass GenCopy: pass @@ -55,6 +60,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass graphchi: SemiSpace: pass GenCopy: pass @@ -64,6 +70,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass h2: SemiSpace: pass GenCopy: pass @@ -73,6 +80,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass h2o: SemiSpace: pass GenCopy: pass @@ -82,6 +90,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass jme: SemiSpace: pass GenCopy: pass @@ -91,6 +100,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass jython: SemiSpace: pass GenCopy: pass @@ -100,6 +110,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass kafka: SemiSpace: pass GenCopy: pass @@ -109,6 +120,7 @@ results: MarkSweep: pass MarkCompact: ignore Compressor: pass + ConcurrentImmix: pass luindex: SemiSpace: pass GenCopy: pass @@ -118,6 +130,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass lusearch: SemiSpace: pass GenCopy: pass @@ -127,6 +140,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass pmd: SemiSpace: pass GenCopy: pass @@ -136,6 +150,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass sunflow: SemiSpace: pass GenCopy: pass @@ -145,6 +160,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass tomcat: SemiSpace: pass GenCopy: pass @@ -154,6 +170,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass xalan: SemiSpace: pass GenCopy: pass @@ -163,6 +180,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass zxing: SemiSpace: pass GenCopy: pass @@ -172,6 +190,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass release: avrora: @@ -183,6 +202,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass batik: SemiSpace: pass GenCopy: pass @@ -192,6 +212,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass biojava: SemiSpace: pass GenCopy: pass @@ -201,6 +222,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass cassandra: SemiSpace: pass GenCopy: pass @@ -210,6 +232,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass eclipse: SemiSpace: pass GenCopy: pass @@ -219,6 +242,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass fop: SemiSpace: pass GenCopy: pass @@ -228,6 +252,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass graphchi: SemiSpace: pass GenCopy: pass @@ -237,6 +262,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass h2: SemiSpace: pass GenCopy: pass @@ -246,6 +272,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass h2o: SemiSpace: pass GenCopy: pass @@ -255,6 +282,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass jme: SemiSpace: pass GenCopy: pass @@ -264,6 +292,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass jython: SemiSpace: pass GenCopy: pass @@ -273,6 +302,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass kafka: SemiSpace: pass GenCopy: pass @@ -282,6 +312,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass luindex: SemiSpace: pass GenCopy: pass @@ -291,6 +322,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass lusearch: SemiSpace: pass GenCopy: pass @@ -300,6 +332,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass pmd: SemiSpace: pass GenCopy: pass @@ -309,6 +342,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass sunflow: SemiSpace: pass GenCopy: pass @@ -318,6 +352,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass tomcat: SemiSpace: pass GenCopy: pass @@ -327,6 +362,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass xalan: SemiSpace: ignore GenCopy: ignore @@ -336,6 +372,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass zxing: SemiSpace: pass GenCopy: pass @@ -345,3 +382,4 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass diff --git a/.github/scripts/ci-matrix-result-check.py b/.github/scripts/ci-matrix-result-check.py index aa5856af..b5664a87 100644 --- a/.github/scripts/ci-matrix-result-check.py +++ b/.github/scripts/ci-matrix-result-check.py @@ -3,19 +3,19 @@ import os import re -if len(sys.argv) < 5: +if len(sys.argv) < 6: raise ValueError("Invalid arguments") -script_dir = os.path.dirname(os.path.abspath(__file__)); -config_path = os.path.join(script_dir, "..", "configs", "base.yml") +script_dir = os.path.dirname(os.path.abspath(__file__)) expected_results_path = os.path.join(script_dir, "ci-expected-results.yml") arch = sys.argv[1] build = sys.argv[2] benchmark = sys.argv[3] log_dir = sys.argv[4] +config_file = sys.argv[5] -def read_in_plans(): +def read_in_plans(config_path): # Load the YAML file with open(config_path, "r") as f: data = yaml.safe_load(f) @@ -119,7 +119,7 @@ def print_log(directory, search_string): print(f"----------------------------------------------") # dict['a'] = 'SemiSpace', etc -plan_dict = read_in_plans() +plan_dict = read_in_plans(config_file) actual = read_in_actual_results(sys.stdin.readline(), plan_dict) expected = read_in_expected_results(build, benchmark) diff --git a/.github/scripts/ci-test-minimal.sh b/.github/scripts/ci-test-minimal.sh index ee224324..54564dd1 100755 --- a/.github/scripts/ci-test-minimal.sh +++ b/.github/scripts/ci-test-minimal.sh @@ -24,6 +24,7 @@ MMTK_PLAN=StickyImmix runbms_dacapo2006_with_heap_multiplier fop 4 MMTK_PLAN=GenCopy runbms_dacapo2006_with_heap_multiplier fop 4 MMTK_PLAN=MarkCompact runbms_dacapo2006_with_heap_multiplier fop 4 MMTK_PLAN=Compressor runbms_dacapo2006_with_heap_multiplier fop 4 +MMTK_PLAN=ConcurrentImmix runbms_dacapo2006_with_heap_multiplier fop 4 -XX:-UseCompressedOops -XX:-UseCompressedClassPointers MMTK_PLAN=MarkSweep runbms_dacapo2006_with_heap_multiplier fop 8 MMTK_PLAN=NoGC runbms_dacapo2006_with_heap_size fop 1000 1000 # Test heap resizing diff --git a/.github/workflows/run-dacapo-chopin-inner.yml b/.github/workflows/run-dacapo-chopin-inner.yml new file mode 100644 index 00000000..8307b0c1 --- /dev/null +++ b/.github/workflows/run-dacapo-chopin-inner.yml @@ -0,0 +1,161 @@ +name: "Test Normal Build" + +on: + workflow_call: + inputs: + config-file: + description: 'Config file name' + required: true + type: string + heap-factor: + description: 'Heap factor' + required: true + type: string + +env: + DACAPO_VERSION: dacapo-23.9-RC3-chopin + DACAPO_FILE: dacapo-23.9-RC3-chopin.zip + DACAPO_DOWNLOAD_URL: https://download.dacapobench.org/chopin/dacapo-23.9-RC3-chopin.zip + +jobs: + cache-dacapo: + runs-on: ubuntu-22.04 + steps: + - name: Check ${{ env.DACAPO_VERSION }} cache + id: check-cache + uses: actions/cache@v3 + with: + path: dacapo/${{ env.DACAPO_FILE }} + key: ${{ env.DACAPO_VERSION }} + lookup-only: true + - name: Install ${{ env.DACAPO_VERSION }} + if: steps.check-cache.outputs.cache-hit != 'true' + run: | + mkdir -p dacapo + pushd dacapo + wget -q "${{ env.DACAPO_DOWNLOAD_URL }}" -O ${{ env.DACAPO_FILE }} + popd + + test-normal-build: + needs: + - cache-dacapo + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + debug-level: ["fastdebug", "release"] + benchmark: + - avrora + - batik + - biojava + - cassandra + - eclipse + - fop + - graphchi + - h2 + - h2o + - jme + - jython + - kafka + - luindex + - lusearch + - pmd + # spring + - sunflow + - tomcat + # tradebeans + # tradesoap + - xalan + - zxing + steps: + - name: Check free space + run: df -h + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + remove-dotnet: true + remove-android: true + remove-haskell: true + remove-codeql: true + remove-docker-images: true + # Leave some room for the runner for logging in /dev/root + root-reserve-mb: 6000 + temp-reserve-mb: 1024 + - name: Check free space + run: df -h + - name: Checkout MMTk OpenJDK binding + uses: actions/checkout@v4 + - name: Setup environment + run: | + pip3 install running-ng + sudo apt-get update -y + sudo apt-get install -y build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libcups2-dev libasound2-dev libxrandr-dev + - name: Check free space and runner log path + run: | + df -h + df . -h + # FIXME: Commenting because GitHub has changed location the home directory + # df /home/runner/runners + - name: Fetch ${{ env.DACAPO_VERSION }} cache + id: fetch-cache + uses: actions/cache@v3 + with: + path: dacapo/${{ env.DACAPO_FILE }} + key: ${{ env.DACAPO_VERSION }} + # fail-on-cache-miss: true # We should never have a cache miss here as we cache DaCapo in an earlier job + # Temporarily change this to false in case the cache download gets + # stuck -- if the cache download is stuck then we go straight to + # upstream and fetch the zip file + fail-on-cache-miss: false + - name: Install ${{ env.DACAPO_VERSION }} + if: steps.fetch-cache.outputs.cache-hit != 'true' + run: | + mkdir -p dacapo + pushd dacapo + wget -q "${{ env.DACAPO_DOWNLOAD_URL }}" -O ${{ env.DACAPO_FILE }} + popd + - name: Unzip ${{ env.DACAPO_VERSION }} + run: | + pushd dacapo + unzip ${{ env.DACAPO_FILE }} + rm ${{ env.DACAPO_FILE }} + popd + - name: Check free space + run: df -h + - name: Download bundles + uses: actions/download-artifact@v4 + with: + name: linux-x86_64-server-${{ matrix.debug-level }}-bundles-normal + path: bundles + - name: Extract OpenJDK + run: | + pushd bundles + tar xvf *.tar.gz + BIN_DIR=`find . -name bin` + mv `dirname $BIN_DIR` jdk + popd + - name: Check free space + run: df -h + - name: Run ${{ env.DACAPO_VERSION }} ${{ matrix.benchmark }} on MMTk OpenJDK ${{ matrix.debug-level }} with ${{ inputs.heap-factor }}x MarkCompact minheap + run: | + DACAPO_PATH=`realpath ./dacapo` + sed -i "s;DACAPO_PATH;$DACAPO_PATH;g" .github/configs/base.yml + echo " - ${{ matrix.benchmark }}" >> .github/configs/${{ inputs.config-file }} + set -o pipefail + running runbms /tmp .github/configs/${{ inputs.config-file }} -s ${{ inputs.heap-factor }} -p linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }} | tee /tmp/running.stdout + - name: Extract running run id + id: extract-running-run-id + run: | + RUN_ID=`sed -n 's/^Run id:.\(.*\)$/\1/p' < /tmp/running.stdout` + echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT + - name: Upload running artifacts + uses: actions/upload-artifact@v4 + with: + name: linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }}-${{ inputs.heap-factor }} + path: /tmp/${{ steps.extract-running-run-id.outputs.run-id }}/ + - name: Check for test failures + run: | + RUNNING_OUTPUT=`sed -n "s/^\(${{ matrix.benchmark }} .*\)$/\1/p" < /tmp/running.stdout` + echo $RUNNING_OUTPUT + pip3 install pyyaml + echo $RUNNING_OUTPUT | python3 .github/scripts/ci-matrix-result-check.py linux-x64 ${{ matrix.debug-level }} ${{ matrix.benchmark }} /tmp/${{ steps.extract-running-run-id.outputs.run-id }}/ .github/configs/${{ inputs.config-file}} diff --git a/.github/workflows/run-dacapo-chopin.yml b/.github/workflows/run-dacapo-chopin.yml index e7615dd8..30458897 100644 --- a/.github/workflows/run-dacapo-chopin.yml +++ b/.github/workflows/run-dacapo-chopin.yml @@ -3,150 +3,15 @@ name: "Test with DaCapo Chopin" on: workflow_call: -env: - DACAPO_VERSION: dacapo-23.9-RC3-chopin - DACAPO_FILE: dacapo-23.9-RC3-chopin.zip - DACAPO_DOWNLOAD_URL: https://download.dacapobench.org/chopin/dacapo-23.9-RC3-chopin.zip - jobs: - cache-dacapo: - runs-on: ubuntu-22.04 - steps: - - name: Check ${{ env.DACAPO_VERSION }} cache - id: check-cache - uses: actions/cache@v3 - with: - path: dacapo/${{ env.DACAPO_FILE }} - key: ${{ env.DACAPO_VERSION }} - lookup-only: true - - name: Install ${{ env.DACAPO_VERSION }} - if: steps.check-cache.outputs.cache-hit != 'true' - run: | - mkdir -p dacapo - pushd dacapo - wget -q "${{ env.DACAPO_DOWNLOAD_URL }}" -O ${{ env.DACAPO_FILE }} - popd + normal-heap: + uses: ./.github/workflows/run-dacapo-chopin-inner.yml + with: + config-file: "normal-heap.yml" + heap-factor: "2.5" - test-normal-build: - needs: - - cache-dacapo - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - debug-level: ["fastdebug", "release"] - benchmark: - - avrora - - batik - - biojava - - cassandra - - eclipse - - fop - - graphchi - - h2 - - h2o - - jme - - jython - - kafka - - luindex - - lusearch - - pmd - # spring - - sunflow - - tomcat - # tradebeans - # tradesoap - - xalan - - zxing - steps: - - name: Check free space - run: df -h - - name: Maximize build space - uses: easimon/maximize-build-space@master - with: - remove-dotnet: true - remove-android: true - remove-haskell: true - remove-codeql: true - remove-docker-images: true - # Leave some room for the runner for logging in /dev/root - root-reserve-mb: 6000 - temp-reserve-mb: 1024 - - name: Check free space - run: df -h - - name: Checkout MMTk OpenJDK binding - uses: actions/checkout@v4 - - name: Setup environment - run: | - pip3 install running-ng - sudo apt-get update -y - sudo apt-get install -y build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libcups2-dev libasound2-dev libxrandr-dev - - name: Check free space and runner log path - run: | - df -h - df . -h - # FIXME: Commenting because GitHub has changed location the home directory - # df /home/runner/runners - - name: Fetch ${{ env.DACAPO_VERSION }} cache - id: fetch-cache - uses: actions/cache@v3 - with: - path: dacapo/${{ env.DACAPO_FILE }} - key: ${{ env.DACAPO_VERSION }} - # fail-on-cache-miss: true # We should never have a cache miss here as we cache DaCapo in an earlier job - # Temporarily change this to false in case the cache download gets - # stuck -- if the cache download is stuck then we go straight to - # upstream and fetch the zip file - fail-on-cache-miss: false - - name: Install ${{ env.DACAPO_VERSION }} - if: steps.fetch-cache.outputs.cache-hit != 'true' - run: | - mkdir -p dacapo - pushd dacapo - wget -q "${{ env.DACAPO_DOWNLOAD_URL }}" -O ${{ env.DACAPO_FILE }} - popd - - name: Unzip ${{ env.DACAPO_VERSION }} - run: | - pushd dacapo - unzip ${{ env.DACAPO_FILE }} - rm ${{ env.DACAPO_FILE }} - popd - - name: Check free space - run: df -h - - name: Download bundles - uses: actions/download-artifact@v4 - with: - name: linux-x86_64-server-${{ matrix.debug-level }}-bundles-normal - path: bundles - - name: Extract OpenJDK - run: | - pushd bundles - tar xvf *.tar.gz - BIN_DIR=`find . -name bin` - mv `dirname $BIN_DIR` jdk - popd - - name: Check free space - run: df -h - - name: Run ${{ env.DACAPO_VERSION }} ${{ matrix.benchmark }} on MMTk OpenJDK ${{ matrix.debug-level }} with 2.5x MarkCompact minheap - run: | - DACAPO_PATH=`realpath ./dacapo` - sed -i "s;DACAPO_PATH;$DACAPO_PATH;g" .github/configs/base.yml - echo " - ${{ matrix.benchmark }}" >> .github/configs/base.yml - set -o pipefail - running runbms /tmp .github/configs/base.yml -s 2.5 -p linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }} | tee /tmp/running.stdout - - name: Extract running run id - id: extract-running-run-id - run: | - RUN_ID=`sed -n 's/^Run id:.\(.*\)$/\1/p' < /tmp/running.stdout` - echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT - - name: Upload running artifacts - uses: actions/upload-artifact@v4 - with: - name: linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }} - path: /tmp/${{ steps.extract-running-run-id.outputs.run-id }}/ - - name: Check for test failures - run: | - RUNNING_OUTPUT=`sed -n "s/^\(${{ matrix.benchmark }} .*\)$/\1/p" < /tmp/running.stdout` - echo $RUNNING_OUTPUT - pip3 install pyyaml - echo $RUNNING_OUTPUT | python3 .github/scripts/ci-matrix-result-check.py linux-x64 ${{ matrix.debug-level }} ${{ matrix.benchmark }} /tmp/${{ steps.extract-running-run-id.outputs.run-id }}/ + large-heap: + uses: ./.github/workflows/run-dacapo-chopin-inner.yml + with: + config-file: "large-heap.yml" + heap-factor: "7" diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index f8edebcc..0e0c77a7 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" dependencies = [ "anstyle", "anstyle-parse", @@ -28,43 +28,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys", + "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", - "windows-sys", + "once_cell_polyfill", + "windows-sys 0.60.2", ] [[package]] name = "atomic" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" dependencies = [ "bytemuck", ] @@ -87,15 +88,15 @@ checksum = "41e67cd8309bbd06cd603a9e693a784ac2e5d1e955f11286e355089fcab3047c" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" [[package]] name = "built" @@ -108,9 +109,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" dependencies = [ "bytemuck_derive", ] @@ -123,15 +124,16 @@ checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] name = "cc" -version = "1.1.18" +version = "1.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "65193589c6404eb80b450d618eaf9a2cafaaafd57ecce47370519ef674a7bd44" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -139,15 +141,15 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "core-foundation-sys" @@ -170,18 +172,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -198,41 +200,41 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "delegate" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b6483c2bbed26f97861cf57651d4f2b731964a28cd2257f934a4b452480d21" +checksum = "6178a82cf56c836a3ba61a7935cdb1c49bfaa6fa4327cd5bf554a503087de26b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] name = "downcast-rs" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8a8b81cacc08888170eef4d13b775126db426d0b348bee9d18c2c1eaf123cf" +checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "enum-map" @@ -251,14 +253,14 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] name = "env_filter" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -266,31 +268,49 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.5" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" dependencies = [ "anstream", "anstyle", "env_filter", - "humantime", + "jiff", "log", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fd99930f64d146689264c637b5af2f0233a933bef0d8570e2526bf9e083192d" + [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi", +] + [[package]] name = "git2" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5220b8ba44c68a9a7f7a7659e864dd73692e417ef0211bea133c7b74e031eeb9" +checksum = "2deb07a133b1520dc1a5690e9bd08950108873d7ed5de38dcc74d3b5ebffa110" dependencies = [ "bitflags", "libc", @@ -307,27 +327,15 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -347,22 +355,22 @@ dependencies = [ [[package]] name = "idna_mapping" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5422cc5bc64289a77dbb45e970b86b5e9a04cb500abc7240505aedc1bf40f38" +checksum = "11c13906586a4b339310541a274dd927aff6fcbb5b8e3af90634c4b31681c792" dependencies = [ "unicode-joining-type", ] [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi", "libc", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -380,12 +388,37 @@ dependencies = [ "either", ] +[[package]] +name = "jiff" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", +] + +[[package]] +name = "jiff-static" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ + "getrandom", "libc", ] @@ -397,15 +430,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.172" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "libgit2-sys" -version = "0.18.1+1.9.0" +version = "0.18.2+1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1dcb20f84ffcdd825c7a311ae347cce604a6f084a767dec4a4929829645290e" +checksum = "1c42fe03df2bd3c53a3a9c7317ad91d80c81cd1fb0caec8d7cc4cd2bfa10c222" dependencies = [ "cc", "libc", @@ -415,9 +448,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.20" +version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" +checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" dependencies = [ "cc", "libc", @@ -427,9 +460,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -437,15 +470,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memoffset" @@ -459,7 +492,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=a061e0519bee0b7fb3b8d768f37885537654486e#a061e0519bee0b7fb3b8d768f37885537654486e" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=a4dd70cb70a116a32b1bbb20501c48f77f49181b#a4dd70cb70a116a32b1bbb20501c48f77f49181b" dependencies = [ "atomic", "atomic-traits", @@ -498,12 +531,12 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=a061e0519bee0b7fb3b8d768f37885537654486e#a061e0519bee0b7fb3b8d768f37885537654486e" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=a4dd70cb70a116a32b1bbb20501c48f77f49181b#a4dd70cb70a116a32b1bbb20501c48f77f49181b" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] @@ -515,6 +548,7 @@ dependencies = [ "cfg-if", "lazy_static", "libc", + "log", "memoffset", "mmtk", "once_cell", @@ -541,37 +575,52 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.7.0" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] [[package]] name = "probe" @@ -605,22 +654,28 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rayon" version = "1.10.0" @@ -643,9 +698,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" dependencies = [ "aho-corasick", "memchr", @@ -655,9 +710,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" dependencies = [ "aho-corasick", "memchr", @@ -666,9 +721,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" [[package]] name = "rustc_version" @@ -681,9 +736,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "scopeguard" @@ -693,9 +748,39 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.23" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.224" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aaeb1e94f53b16384af593c71e20b095e958dab1d26939c1b70645c5cfbcc0b" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.224" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f39390fa6346e24defbcdd3d9544ba8a19985d0af74df8501fbfe9a64341ab" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.224" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ff78ab5e8561c9a675bfc1785cb07ae721f0ee53329a595cefd8c04c2ac4e0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] [[package]] name = "shlex" @@ -705,9 +790,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "spin" @@ -726,21 +811,20 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strum" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" [[package]] name = "strum_macros" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" dependencies = [ "heck", "proc-macro2", "quote", - "rustversion", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] @@ -755,9 +839,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -780,9 +864,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -795,40 +879,41 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-joining-type" -version = "0.7.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f8cb47ccb8bc750808755af3071da4a10dcd147b68fc874b7ae4b12543f6f5" +checksum = "d8d00a78170970967fdb83f9d49b92f959ab2bb829186b113e4f4604ad98e180" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -855,6 +940,24 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "wasi" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + [[package]] name = "winapi" version = "0.3.9" @@ -884,7 +987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" dependencies = [ "windows-core", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -896,7 +999,7 @@ dependencies = [ "windows-implement", "windows-interface", "windows-result", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -907,7 +1010,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] @@ -918,25 +1021,40 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + [[package]] name = "windows-result" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets", + "windows-targets 0.53.3", ] [[package]] @@ -945,14 +1063,31 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] @@ -961,44 +1096,98 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index c0983082..dee30842 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -23,6 +23,7 @@ openjdk_version = "28e56ee32525c32c5a88391d0b01f24e5cd16c0f" [dependencies] libc = "0.2" lazy_static = "1.1" +log = { version = "0.4", features = ["max_level_trace"] } once_cell = "1.10.0" atomic = "0.6.0" memoffset = "0.9.0" @@ -35,7 +36,7 @@ probe = "0.5" # - change branch # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI. -mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "a061e0519bee0b7fb3b8d768f37885537654486e" } +mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "a4dd70cb70a116a32b1bbb20501c48f77f49181b" } # Uncomment the following to build locally # mmtk = { path = "../repos/mmtk-core" } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 19c59580..5520e88b 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -47,6 +47,7 @@ macro_rules! with_mutator { static NO_BARRIER: sync::Lazy = sync::Lazy::new(|| CString::new("NoBarrier").unwrap()); static OBJECT_BARRIER: sync::Lazy = sync::Lazy::new(|| CString::new("ObjectBarrier").unwrap()); +static SATB_BARRIER: sync::Lazy = sync::Lazy::new(|| CString::new("SATBBarrier").unwrap()); #[no_mangle] pub extern "C" fn get_mmtk_version() -> *const c_char { @@ -59,6 +60,7 @@ pub extern "C" fn mmtk_active_barrier() -> *const c_char { match singleton.get_plan().constraints().barrier { BarrierSelector::NoBarrier => NO_BARRIER.as_ptr(), BarrierSelector::ObjectBarrier => OBJECT_BARRIER.as_ptr(), + BarrierSelector::SATBBarrier => SATB_BARRIER.as_ptr(), // In case we have more barriers in mmtk-core. #[allow(unreachable_patterns)] _ => unimplemented!(), @@ -381,6 +383,11 @@ pub extern "C" fn executable() -> bool { true } +#[no_mangle] +pub extern "C" fn mmtk_load_reference(mutator: *mut libc::c_void, o: ObjectReference) { + with_mutator!(|mutator| mutator.barrier().load_weak_reference(o)) +} + /// Full pre barrier #[no_mangle] pub extern "C" fn mmtk_object_reference_write_pre( diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index 2924c14e..4e71d610 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -3,7 +3,7 @@ use mmtk::util::opaque_pointer::*; use mmtk::vm::{Collection, GCThreadContext}; use mmtk::Mutator; -use crate::UPCALLS; +use crate::{singleton, UPCALLS}; use crate::{MutatorClosure, OpenJDK}; pub struct VMCollection {} @@ -24,6 +24,18 @@ impl Collection> for VMCollection { } fn resume_mutators(tls: VMWorkerThread) { + if *crate::singleton::().get_options().plan + == mmtk::util::options::PlanSelector::ConcurrentImmix + { + // For concurrent Immix, we need to check if SATB is active + let concurrent_plan = singleton::().get_plan().concurrent().unwrap(); + let concurrent_marking_active = concurrent_plan.concurrent_work_in_progress(); + + unsafe { + crate::CONCURRENT_MARKING_ACTIVE = if concurrent_marking_active { 1 } else { 0 }; + } + log::debug!("Set CONCURRENT_MARKING_ACTIVE to {concurrent_marking_active}"); + } unsafe { ((*UPCALLS).resume_mutators)(tls); } diff --git a/mmtk/src/lib.rs b/mmtk/src/lib.rs index 3b1f54a2..cd37988b 100644 --- a/mmtk/src/lib.rs +++ b/mmtk/src/lib.rs @@ -139,6 +139,9 @@ pub static VO_BIT_ADDRESS: uintptr_t = pub static FREE_LIST_ALLOCATOR_SIZE: uintptr_t = std::mem::size_of::>>(); +#[no_mangle] +pub static mut CONCURRENT_MARKING_ACTIVE: u8 = 0; + #[derive(Default)] pub struct OpenJDK; diff --git a/openjdk/barriers/mmtkObjectBarrier.cpp b/openjdk/barriers/mmtkObjectBarrier.cpp index d6cf10a0..5f14723c 100644 --- a/openjdk/barriers/mmtkObjectBarrier.cpp +++ b/openjdk/barriers/mmtkObjectBarrier.cpp @@ -135,6 +135,57 @@ void MMTkObjectBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, Dec #undef __ +#define __ sasm-> + +void MMTkObjectBarrierSetAssembler::generate_c1_post_write_barrier_runtime_stub(StubAssembler* sasm) const { + __ prologue("mmtk_object_barrier", false); + + Label done, runtime; + + __ push(c_rarg0); + __ push(c_rarg1); + __ push(c_rarg2); + __ push(rax); + + __ load_parameter(0, c_rarg0); + __ load_parameter(1, c_rarg1); + __ load_parameter(2, c_rarg2); + + __ bind(runtime); + + __ save_live_registers_no_oop_map(true); + + if (mmtk_enable_barrier_fastpath) { + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); + } else { + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_post_call), 3); + } + + __ restore_live_registers(true); + + __ bind(done); + __ pop(rax); + __ pop(c_rarg2); + __ pop(c_rarg1); + __ pop(c_rarg0); + + __ epilogue(); +} + +#undef __ +#define __ ce->masm()-> + +void MMTkObjectBarrierSetAssembler::generate_c1_post_write_barrier_stub(LIR_Assembler* ce, MMTkC1PostBarrierStub* stub) const { + MMTkBarrierSetC1* bs = (MMTkBarrierSetC1*) BarrierSet::barrier_set()->barrier_set_c1(); + __ bind(*stub->entry()); + ce->store_parameter(stub->src->as_pointer_register(), 0); + ce->store_parameter(stub->slot->as_pointer_register(), 1); + ce->store_parameter(stub->new_val->as_pointer_register(), 2); + __ call(RuntimeAddress(bs->post_barrier_c1_runtime_code_blob()->code_begin())); + __ jmp(*stub->continuation()); +} +#undef __ + #ifdef ASSERT #define __ gen->lir(__FILE__, __LINE__)-> #else @@ -175,7 +226,7 @@ void MMTkObjectBarrierSetC1::object_reference_write_post(LIRAccess& access, LIR_ new_val = new_val_reg; } assert(new_val->is_register(), "must be a register at this point"); - CodeStub* slow = new MMTkC1BarrierStub(src, slot, new_val); + CodeStub* slow = new MMTkC1PostBarrierStub(src, slot, new_val); if (mmtk_enable_barrier_fastpath) { LIR_Opr addr = src; diff --git a/openjdk/barriers/mmtkObjectBarrier.hpp b/openjdk/barriers/mmtkObjectBarrier.hpp index 6baf7bae..c04081d3 100644 --- a/openjdk/barriers/mmtkObjectBarrier.hpp +++ b/openjdk/barriers/mmtkObjectBarrier.hpp @@ -31,7 +31,10 @@ class MMTkObjectBarrierSetRuntime: public MMTkBarrierSetRuntime { class MMTkObjectBarrierSetAssembler: public MMTkBarrierSetAssembler { protected: virtual void object_reference_write_post(MacroAssembler* masm, DecoratorSet decorators, Address dst, Register val, Register tmp1, Register tmp2, bool compensate_val_reg) const override; + /// Generate C1 write barrier slow-call assembly code + virtual void generate_c1_post_write_barrier_runtime_stub(StubAssembler* sasm) const override; public: + virtual void generate_c1_post_write_barrier_stub(LIR_Assembler* ce, MMTkC1PostBarrierStub* stub) const override; virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) override; virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) override; }; diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp new file mode 100644 index 00000000..3a75ccc5 --- /dev/null +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -0,0 +1,533 @@ +// Workaround the fact that LIR_Assembler::as_Address is private. +#define private public + +#include "precompiled.hpp" +#include "mmtkSATBBarrier.hpp" +#include "runtime/interfaceSupport.inline.hpp" + +#define SOFT_REFERENCE_LOAD_BARRIER true + +constexpr int kUnloggedValue = 1; + +static inline intptr_t side_metadata_base_address() { + return SATB_METADATA_BASE_ADDRESS; +} + +void MMTkSATBBarrierSetRuntime::load_reference(DecoratorSet decorators, oop value) const { +#if SOFT_REFERENCE_LOAD_BARRIER + if (CONCURRENT_MARKING_ACTIVE == 1 && value != NULL) + ::mmtk_load_reference((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, (void*) value); +#endif +}; + +void MMTkSATBBarrierSetRuntime::object_probable_write(oop new_obj) const { + // We intentionally leave this method blank. + // This method is called after slowpath allocation exits. + // Because the new_obj is just allocated, + // it does not have any fields holding old values for the SATB barrier to remember. +} + +void MMTkSATBBarrierSetRuntime::object_reference_write_pre(oop src, oop* slot, oop target) const { + if (mmtk_enable_barrier_fastpath) { + // oop pre_val = *slot; + // if (pre_val == NULL) return; + intptr_t addr = ((intptr_t) (void*) src); + const volatile uint8_t * meta_addr = (const volatile uint8_t *) (side_metadata_base_address() + (addr >> 6)); + intptr_t shift = (addr >> 3) & 0b111; + uint8_t byte_val = *meta_addr; + if (((byte_val >> shift) & 1) == kUnloggedValue) { + object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); + } + } else { + object_reference_write_pre_call((void*) src, (void*) slot, (void*) target); + } +} + +#define __ masm-> + +void MMTkSATBBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp_thread) { + bool on_oop = type == T_OBJECT || type == T_ARRAY; + bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0; + bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0; + bool on_reference = on_weak || on_phantom; + BarrierSetAssembler::load_at(masm, decorators, type, dst, src, tmp1, tmp_thread); +#if SOFT_REFERENCE_LOAD_BARRIER + if (on_oop && on_reference) { + Label done; + // No slow-call if SATB is not active + Register tmp = rscratch1; + Register tmp2 = rscratch2; + __ movptr(tmp, intptr_t(&CONCURRENT_MARKING_ACTIVE)); + __ xorq(tmp2, tmp2); + __ movb(tmp2, Address(tmp, 0)); + __ cmpptr(tmp2, 1); + __ jcc(Assembler::notEqual, done); + // No slow-call if dst is NULL + __ cmpptr(dst, 0); + __ jcc(Assembler::equal, done); + // Do slow-call + __ pusha(); + __ mov(c_rarg0, dst); + __ MacroAssembler::call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::load_reference_call), 1); + __ popa(); + __ bind(done); + } +#endif +} + +void MMTkSATBBarrierSetAssembler::object_reference_write_pre(MacroAssembler* masm, DecoratorSet decorators, Address dst, Register val, Register tmp1, Register tmp2) const { + if (can_remove_barrier(decorators, val, /* skip_const_null */ false)) return; + + if (mmtk_enable_barrier_fastpath) { + Label done; + + Register obj = dst.base(); + Register tmp3 = rscratch1; + Register tmp4 = rscratch2; + Register tmp5 = tmp1 == dst.base() || tmp1 == dst.index() ? tmp2 : tmp1; + + // tmp5 = load-byte (side_metadata_base_address() + (obj >> 6)); + __ movptr(tmp3, obj); + // __ load_heap_oop(tmp3, dst, noreg, noreg, AS_RAW); + // // Is the previous value null? + // __ cmpptr(tmp3, (int32_t) NULL_WORD); + // __ jcc(Assembler::equal, done); + + __ shrptr(tmp3, 6); + __ movptr(tmp5, side_metadata_base_address()); + __ movzbl(tmp5, Address(tmp5, tmp3)); + + // tmp3 = (obj >> 3) & 7 + __ mov(tmp3, obj); + __ shrptr(tmp3, 3); + __ andptr(tmp3, 7); + // tmp5 = tmp5 >> tmp3 + __ movptr(tmp4, rcx); + __ movl(rcx, tmp3); + __ shrptr(tmp5); + __ movptr(rcx, tmp4); + // if ((tmp5 & 1) == 1) goto slowpath; + __ andptr(tmp5, 1); + __ cmpptr(tmp5, kUnloggedValue); + __ jcc(Assembler::notEqual, done); + + // TODO: Spill fewer registers + __ pusha(); + __ movptr(c_rarg0, dst.base()); + __ lea(c_rarg1, dst); + __ movptr(c_rarg2, val == noreg ? (int32_t) NULL_WORD : val); + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); + __ popa(); + + __ bind(done); + } else { + __ pusha(); + __ movptr(c_rarg0, dst.base()); + __ lea(c_rarg1, dst); + __ movptr(c_rarg2, val == noreg ? (int32_t) NULL_WORD : val); + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), 3); + __ popa(); + } +} + +void MMTkSATBBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) { + // `count` or `dst` register values may get overwritten after the array copy, and `arraycopy_epilogue` can receive invalid addresses. + // Save the register values here and restore them in `arraycopy_epilogue`. + // See https://github.com/openjdk/jdk/blob/jdk-11%2B19/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp#L37-L50 + + if (type == T_OBJECT || type == T_ARRAY) { + Label done; + // // Bailout if count is zero + __ cmpptr(count, 0); + __ jcc(Assembler::equal, done); + __ pusha(); + __ movptr(c_rarg0, src); + __ movptr(c_rarg1, dst); + __ movptr(c_rarg2, count); + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_array_copy_pre_call), 3); + __ popa(); + __ bind(done); + } +} + +#undef __ + +#define __ sasm-> + +void MMTkSATBBarrierSetAssembler::generate_c1_pre_write_barrier_runtime_stub(StubAssembler* sasm) const { + __ prologue("mmtk_satb_barrier", false); + + Label done, runtime; + + __ push(c_rarg0); + __ push(c_rarg1); + __ push(c_rarg2); + __ push(rax); + + __ load_parameter(0, c_rarg0); + __ load_parameter(1, c_rarg1); + __ load_parameter(2, c_rarg2); + + __ bind(runtime); + + __ save_live_registers_no_oop_map(true); + + if (mmtk_enable_barrier_fastpath) { + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); + } else { + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), 3); + } + + __ restore_live_registers(true); + + __ bind(done); + __ pop(rax); + __ pop(c_rarg2); + __ pop(c_rarg1); + __ pop(c_rarg0); + + __ epilogue(); +} + +#undef __ +#define __ ce->masm()-> + +void MMTkSATBBarrierSetAssembler::generate_c1_pre_write_barrier_stub(LIR_Assembler* ce, MMTkC1PreBarrierStub* stub) const { + MMTkBarrierSetC1* bs = (MMTkBarrierSetC1*) BarrierSet::barrier_set()->barrier_set_c1(); + __ bind(*stub->entry()); + + // For pre-barriers, stub->slot may not be a resolved address. + // Manually patch the address + address runtime_address; + if (stub->patch_code != lir_patch_none) { + // Patch + assert(stub->scratch->is_single_cpu(), "must be"); + assert(stub->scratch->is_register(), "Precondition."); + ce->mem2reg(stub->slot, stub->scratch, T_OBJECT, stub->patch_code, stub->info, false /*wide*/, false /*unaligned*/); + // Now stub->scratch contains the pre_val instead of the slot address + // So the following is to load the slot address into scrach register + // Resolve address + auto masm = ce->masm(); + LIR_Address* addr = stub->slot->as_address_ptr(); + Address from_addr = ce->as_Address(addr); + __ lea(stub->scratch->as_register(), from_addr); + // Store parameter + ce->store_parameter(stub->scratch->as_pointer_register(), 1); + } else { + // Store parameter + ce->store_parameter(stub->slot->as_pointer_register(), 1); + } + + ce->store_parameter(stub->src->as_pointer_register(), 0); + ce->store_parameter(stub->new_val->as_pointer_register(), 2); + __ call(RuntimeAddress(bs->pre_barrier_c1_runtime_code_blob()->code_begin())); + __ jmp(*stub->continuation()); +} + +#undef __ + +#ifdef ASSERT +#define __ gen->lir(__FILE__, __LINE__)-> +#else +#define __ gen->lir()-> +#endif + + +void MMTkSATBBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) { + DecoratorSet decorators = access.decorators(); + bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0; + bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0; + bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; + LIRGenerator *gen = access.gen(); + + BarrierSetC1::load_at_resolved(access, result); + +#if SOFT_REFERENCE_LOAD_BARRIER + if (access.is_oop() && (is_weak || is_phantom || is_anonymous)) { + // Register the value in the referent field with the pre-barrier + LabelObj *Lcont_anonymous; + if (is_anonymous) { + Lcont_anonymous = new LabelObj(); + generate_referent_check(access, Lcont_anonymous); + } + assert(result->is_register(), "must be"); + assert(result->type() == T_OBJECT, "must be an object"); + auto slow = new MMTkC1ReferenceLoadBarrierStub(result, access.patch_emit_info()); + // Call slow-path only when concurrent marking is active + LIR_Opr cm_flag_addr_opr = gen->new_pointer_register(); + __ move(LIR_OprFact::longConst(uintptr_t(&CONCURRENT_MARKING_ACTIVE)), cm_flag_addr_opr); + LIR_Address* cm_flag_addr = new LIR_Address(cm_flag_addr_opr, T_BYTE); + LIR_Opr cm_flag = gen->new_register(T_INT); + __ move(cm_flag_addr, cm_flag); + // No slow-call if SATB is not active + __ cmp(lir_cond_equal, cm_flag, LIR_OprFact::intConst(1)); + __ branch(lir_cond_equal, T_BYTE, slow); + __ branch_destination(slow->continuation()); + if (is_anonymous) { + __ branch_destination(Lcont_anonymous->label()); + } + } +#endif +} + +void MMTkSATBBarrierSetC1::object_reference_write_pre(LIRAccess& access, LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* info) const { + LIRGenerator* gen = access.gen(); + DecoratorSet decorators = access.decorators(); + if ((decorators & IN_HEAP) == 0) return; // Not sure if this line is sound + bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0; + if (!src->is_register()) { + LIR_Opr reg = gen->new_pointer_register(); + if (src->is_constant()) { + __ move(src, reg); + } else { + __ leal(src, reg); + } + src = reg; + } + assert(src->is_register(), "must be a register at this point"); + + if (!slot->is_register() && !needs_patching) { + LIR_Address* address = slot->as_address_ptr(); + LIR_Opr ptr = gen->new_pointer_register(); + if (!address->index()->is_valid() && address->disp() == 0) { + __ move(address->base(), ptr); + } else { + assert(address->disp() != max_jint, "lea doesn't support patched addresses!"); + __ leal(slot, ptr); + } + slot = ptr; + } else if (needs_patching && !slot->is_address()) { + assert(slot->is_register(), "must be"); + slot = LIR_OprFact::address(new LIR_Address(slot, T_OBJECT)); + } + assert(needs_patching || slot->is_register(), "must be a register at this point unless needs_patching"); + if (!new_val->is_register()) { + LIR_Opr new_val_reg = gen->new_register(T_OBJECT); + if (new_val->is_constant()) { + __ move(new_val, new_val_reg); + } else { + __ leal(new_val, new_val_reg); + } + new_val = new_val_reg; + } + assert(new_val->is_register(), "must be a register at this point"); + MMTkC1PreBarrierStub* slow = new MMTkC1PreBarrierStub(src, slot, new_val, info, needs_patching ? lir_patch_normal : lir_patch_none); + if (needs_patching) slow->scratch = gen->new_register(T_OBJECT); + + if (mmtk_enable_barrier_fastpath) { + if (needs_patching) { + // At this stage, slot address is not available, so cannot do the fast-path check until + // its address get resolved + // FIXME: Jump to a medium-path for code patching without entering slow-path + __ jump(slow); + } else { + // // load pre_val + // LIR_Address* slot_addr = new LIR_Address(slot, T_OBJECT); + // LIR_Opr addr = slot; + // __ load(slot_addr, addr); + // // if pre_val == NULL skip the barrier + // __ cmp(lir_cond_equal, addr, LIR_OprFact::oopConst(NULL)); + // __ branch(lir_cond_equal, T_OBJECT, slow->continuation()); + LIR_Opr addr = src; + // uint8_t* meta_addr = (uint8_t*) (side_metadata_base_address() + (addr >> 6)); + LIR_Opr offset = gen->new_pointer_register(); + __ move(addr, offset); + __ unsigned_shift_right(offset, 6, offset); + LIR_Opr base = gen->new_pointer_register(); + __ move(LIR_OprFact::longConst(side_metadata_base_address()), base); + LIR_Address* meta_addr = new LIR_Address(base, offset, T_BYTE); + // uint8_t byte_val = *meta_addr; + LIR_Opr byte_val = gen->new_register(T_INT); + __ move(meta_addr, byte_val); + + // intptr_t shift = (addr >> 3) & 0b111; + LIR_Opr shift = gen->new_register(T_INT); + __ move(addr, shift); + __ unsigned_shift_right(shift, 3, shift); + __ logical_and(shift, LIR_OprFact::intConst(0b111), shift); + // if (((byte_val >> shift) & 1) == 1) slow; + LIR_Opr result = byte_val; + __ unsigned_shift_right(result, shift, result, LIR_OprFact::illegalOpr); + __ logical_and(result, LIR_OprFact::intConst(1), result); + __ cmp(lir_cond_equal, result, LIR_OprFact::intConst(1)); + __ branch(lir_cond_equal, T_BYTE, slow); + } + } else { + __ jump(slow); + } + + __ branch_destination(slow->continuation()); +} + +#undef __ + +#define __ ideal. + +void MMTkSATBBarrierSetC2::object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* val) const { + if (can_remove_barrier(kit, &kit->gvn(), src, slot, val, /* skip_const_null */ false)) return; + + MMTkIdealKit ideal(kit, true); + + if (mmtk_enable_barrier_fastpath) { + Node* no_base = __ top(); + float unlikely = PROB_UNLIKELY(0.999); + + Node* zero = __ ConI(0); + Node* addr = __ CastPX(__ ctrl(), src); + Node* meta_addr = __ AddP(no_base, __ ConP(side_metadata_base_address()), __ URShiftX(addr, __ ConI(6))); + Node* byte = __ load(__ ctrl(), meta_addr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); + + Node* shift = __ URShiftX(addr, __ ConI(3)); + shift = __ AndI(__ ConvL2I(shift), __ ConI(7)); + Node* result = __ AndI(__ URShiftI(byte, shift), __ ConI(1)); + __ if_then(result, BoolTest::ne, zero, unlikely); { + const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM); + Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), "mmtk_barrier_call", src, slot, val); + } __ end_if(); + } else { + const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM); + Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), "mmtk_barrier_call", src, slot, val); + // Looks like this is necessary + // See https://github.com/mmtk/openjdk/blob/c82e5c44adced4383162826c2c3933a83cfb139b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp#L288-L291 + Node* call = __ ctrl()->in(0); + call->add_req(slot); + } + + kit->final_sync(ideal); // Final sync IdealKit and GraphKit. +} + +static void reference_load_barrier(GraphKit* kit, Node* slot, Node* val, bool emit_barrier) { + MMTkIdealKit ideal(kit, true); + Node* no_base = __ top(); + float unlikely = PROB_UNLIKELY(0.999); + Node* zero = __ ConI(0); + Node* cm_flag = __ load(__ ctrl(), __ ConP(uintptr_t(&CONCURRENT_MARKING_ACTIVE)), TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); + // No slow-call if SATB is not active + __ if_then(cm_flag, BoolTest::ne, zero, unlikely); { + // No slow-call if dst is NULL + __ if_then(val, BoolTest::ne, kit->null()); { + const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM); + Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::load_reference_call), "mmtk_barrier_call", val); + } __ end_if(); + } __ end_if(); + kit->sync_kit(ideal); + if (emit_barrier) kit->insert_mem_bar(Op_MemBarCPUOrder); + kit->final_sync(ideal); // Final sync IdealKit and GraphKit. +} + +static void reference_load_barrier_for_unknown_load(GraphKit* kit, Node* base_oop, Node* offset, Node* slot, Node* val, bool need_mem_bar) { + // We could be accessing the referent field of a reference object. If so, when G1 + // is enabled, we need to log the value in the referent field in an SATB buffer. + // This routine performs some compile time filters and generates suitable + // runtime filters that guard the pre-barrier code. + // Also add memory barrier for non volatile load from the referent field + // to prevent commoning of loads across safepoint. + + // Some compile time checks. + + // If offset is a constant, is it java_lang_ref_Reference::_reference_offset? + const TypeX* otype = offset->find_intptr_t_type(); + if (otype != NULL && otype->is_con() && + otype->get_con() != java_lang_ref_Reference::referent_offset) { + // Constant offset but not the reference_offset so just return + return; + } + + // We only need to generate the runtime guards for instances. + const TypeOopPtr* btype = base_oop->bottom_type()->isa_oopptr(); + if (btype != NULL) { + if (btype->isa_aryptr()) { + // Array type so nothing to do + return; + } + + const TypeInstPtr* itype = btype->isa_instptr(); + if (itype != NULL) { + // Can the klass of base_oop be statically determined to be + // _not_ a sub-class of Reference and _not_ Object? + ciKlass* klass = itype->klass(); + if ( klass->is_loaded() && + !klass->is_subtype_of(kit->env()->Reference_klass()) && + !kit->env()->Object_klass()->is_subtype_of(klass)) { + return; + } + } + } + + float likely = PROB_LIKELY( 0.999); + float unlikely = PROB_UNLIKELY(0.999); + + IdealKit ideal(kit); + + Node* referent_off = __ ConX(java_lang_ref_Reference::referent_offset); + + __ if_then(offset, BoolTest::eq, referent_off, unlikely); { + // Update graphKit memory and control from IdealKit. + kit->sync_kit(ideal); + Node* ref_klass_con = kit->makecon(TypeKlassPtr::make(kit->env()->Reference_klass())); + Node* is_instof = kit->gen_instanceof(base_oop, ref_klass_con); + // Update IdealKit memory and control from graphKit. + __ sync_kit(kit); + Node* one = __ ConI(1); + // is_instof == 0 if base_oop == NULL + __ if_then(is_instof, BoolTest::eq, one, unlikely); { + // Update graphKit from IdeakKit. + kit->sync_kit(ideal); + // Use the pre-barrier to record the value in the referent field + reference_load_barrier(kit, slot, val, false); + if (need_mem_bar) { + // Add memory barrier to prevent commoning reads from this field + // across safepoint since GC can change its value. + kit->insert_mem_bar(Op_MemBarCPUOrder); + } + // Update IdealKit from graphKit. + __ sync_kit(kit); + } __ end_if(); // _ref_type != ref_none + } __ end_if(); // offset == referent_offset + + // Final sync IdealKit and GraphKit. + kit->final_sync(ideal); +} + +Node* MMTkSATBBarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) const { + + DecoratorSet decorators = access.decorators(); + GraphKit* kit = access.kit(); + + Node* adr = access.addr().node(); + Node* obj = access.base(); + + bool mismatched = (decorators & C2_MISMATCHED) != 0; + bool unknown = (decorators & ON_UNKNOWN_OOP_REF) != 0; + bool in_heap = (decorators & IN_HEAP) != 0; + bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0; + bool is_unordered = (decorators & MO_UNORDERED) != 0; + bool need_cpu_mem_bar = !is_unordered || mismatched || !in_heap; + + Node* offset = adr->is_AddP() ? adr->in(AddPNode::Offset) : kit->top(); + Node* load = BarrierSetC2::load_at_resolved(access, val_type); + + // If we are reading the value of the referent field of a Reference + // object (either by using Unsafe directly or through reflection) + // then, if G1 is enabled, we need to record the referent in an + // SATB log buffer using the pre-barrier mechanism. + // Also we need to add memory barrier to prevent commoning reads + // from this field across safepoint since GC can change its value. + bool need_read_barrier = in_heap && (on_weak || (unknown && offset != kit->top() && obj != kit->top())); + + if (!access.is_oop() || !need_read_barrier) { + return load; + } + +#if SOFT_REFERENCE_LOAD_BARRIER + if (on_weak) { + reference_load_barrier(kit, adr, load, true); + } else if (unknown) { + reference_load_barrier_for_unknown_load(kit, obj, offset, adr, load, !need_cpu_mem_bar); + } +#endif + + return load; +} + +#undef __ diff --git a/openjdk/barriers/mmtkSATBBarrier.hpp b/openjdk/barriers/mmtkSATBBarrier.hpp new file mode 100644 index 00000000..1f5cf639 --- /dev/null +++ b/openjdk/barriers/mmtkSATBBarrier.hpp @@ -0,0 +1,73 @@ +#ifndef MMTK_OPENJDK_BARRIERS_MMTK_SATB_BARRIER_HPP +#define MMTK_OPENJDK_BARRIERS_MMTK_SATB_BARRIER_HPP + +#include "../mmtk.h" +#include "../mmtkBarrierSet.hpp" +#include "../mmtkBarrierSetAssembler_x86.hpp" +#include "../mmtkBarrierSetC1.hpp" +#include "../mmtkBarrierSetC2.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "gc/shared/barrierSet.hpp" +#include "opto/callnode.hpp" +#include "opto/idealKit.hpp" + +#define SIDE_METADATA_WORST_CASE_RATIO_LOG 1 +#define LOG_BYTES_IN_CHUNK 22 +#define CHUNK_MASK ((1L << LOG_BYTES_IN_CHUNK) - 1) + +const intptr_t SATB_METADATA_BASE_ADDRESS = (intptr_t) GLOBAL_SIDE_METADATA_VM_BASE_ADDRESS; + +class MMTkSATBBarrierSetRuntime: public MMTkBarrierSetRuntime { +public: + // Interfaces called by `MMTkBarrierSet::AccessBarrier` + virtual void object_reference_write_pre(oop src, oop* slot, oop target) const override; + virtual void object_reference_array_copy_pre(oop* src, oop* dst, size_t count) const override { + if (count == 0) return; + ::mmtk_array_copy_pre((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, (void*) src, (void*) dst, count); + } + virtual void object_probable_write(oop new_obj) const override; + virtual void load_reference(DecoratorSet decorators, oop value) const override; +}; + +class MMTkSATBBarrierSetAssembler: public MMTkBarrierSetAssembler { +protected: + virtual void object_reference_write_pre(MacroAssembler* masm, DecoratorSet decorators, Address dst, Register val, Register tmp1, Register tmp2) const override; + /// Generate C1 write barrier slow-call assembly code + virtual void generate_c1_pre_write_barrier_runtime_stub(StubAssembler* sasm) const override; +public: + virtual void generate_c1_pre_write_barrier_stub(LIR_Assembler* ce, MMTkC1PreBarrierStub* stub) const override; + virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) override; + virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp_thread) override; +}; + +class MMTkSATBBarrierSetC1: public MMTkBarrierSetC1 { +protected: + virtual void object_reference_write_pre(LIRAccess& access, LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* info) const override; + + virtual void load_at_resolved(LIRAccess& access, LIR_Opr result) override; + + virtual LIR_Opr resolve_address(LIRAccess& access, bool resolve_in_register) override { + return MMTkBarrierSetC1::resolve_address_in_register(access, resolve_in_register); + } +}; + +class MMTkSATBBarrierSetC2: public MMTkBarrierSetC2 { +protected: + virtual void object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* val) const override; + +public: + virtual bool array_copy_requires_gc_barriers(BasicType type) const override { + return false; + } + virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const override; +}; + +struct MMTkSATBBarrier: MMTkBarrierImpl< + MMTkSATBBarrierSetRuntime, + MMTkSATBBarrierSetAssembler, + MMTkSATBBarrierSetC1, + MMTkSATBBarrierSetC2 +> {}; + +#endif // MMTK_OPENJDK_BARRIERS_MMTK_OBJECT_BARRIER_HPP diff --git a/openjdk/mmtk.h b/openjdk/mmtk.h index 89930abd..da750071 100644 --- a/openjdk/mmtk.h +++ b/openjdk/mmtk.h @@ -23,6 +23,7 @@ extern const uintptr_t GLOBAL_SIDE_METADATA_VM_BASE_ADDRESS; extern const uintptr_t VO_BIT_ADDRESS; extern const size_t MMTK_MARK_COMPACT_HEADER_RESERVED_IN_BYTES; extern const uintptr_t FREE_LIST_ALLOCATOR_SIZE; +extern uint8_t CONCURRENT_MARKING_ACTIVE; extern const char* get_mmtk_version(); @@ -46,6 +47,9 @@ extern void* alloc_slow_largeobject(MMTk_Mutator mutator, size_t size, extern void post_alloc(MMTk_Mutator mutator, void* refer, size_t bytes, int allocator); +/// java.lang.Reference load barrier +extern void mmtk_load_reference(MMTk_Mutator mutator, void* obj); + /// Full pre-barrier extern void mmtk_object_reference_write_pre(MMTk_Mutator mutator, void* src, void* slot, void* target); diff --git a/openjdk/mmtkBarrierSet.cpp b/openjdk/mmtkBarrierSet.cpp index ab9ad164..d0c4838a 100644 --- a/openjdk/mmtkBarrierSet.cpp +++ b/openjdk/mmtkBarrierSet.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "barriers/mmtkNoBarrier.hpp" #include "barriers/mmtkObjectBarrier.hpp" +#include "barriers/mmtkSATBBarrier.hpp" #include "mmtkBarrierSet.hpp" #include "mmtkBarrierSetAssembler_x86.hpp" #include "runtime/interfaceSupport.inline.hpp" @@ -82,6 +83,7 @@ MMTkBarrierBase* get_selected_barrier() { const char* barrier = mmtk_active_barrier(); if (strcmp(barrier, "NoBarrier") == 0) selected_barrier = new MMTkNoBarrier(); else if (strcmp(barrier, "ObjectBarrier") == 0) selected_barrier = new MMTkObjectBarrier(); + else if (strcmp(barrier, "SATBBarrier") == 0) selected_barrier = new MMTkSATBBarrier(); else guarantee(false, "Unimplemented"); return selected_barrier; } @@ -154,3 +156,7 @@ void MMTkBarrierSetRuntime::object_reference_array_copy_pre_call(void* src, void void MMTkBarrierSetRuntime::object_reference_array_copy_post_call(void* src, void* dst, size_t count) { ::mmtk_array_copy_post((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, src, dst, count); } + +void MMTkBarrierSetRuntime::load_reference_call(void* ref) { + ::mmtk_load_reference((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, ref); +} diff --git a/openjdk/mmtkBarrierSet.hpp b/openjdk/mmtkBarrierSet.hpp index 0b614020..37400e2a 100644 --- a/openjdk/mmtkBarrierSet.hpp +++ b/openjdk/mmtkBarrierSet.hpp @@ -60,6 +60,8 @@ MMTkAllocatorOffsets get_tlab_top_and_end_offsets(AllocatorSelector selector); class MMTkBarrierSetRuntime: public CHeapObj { public: + /// Weak ref load barrier + static void load_reference_call(void* ref); /// Generic pre-write barrier. Called by fast-paths. static void object_reference_write_pre_call(void* src, void* slot, void* target); /// Generic post-write barrier. Called by fast-paths. @@ -76,7 +78,8 @@ class MMTkBarrierSetRuntime: public CHeapObj { || call == CAST_FROM_FN_PTR(address, object_reference_write_post_call) || call == CAST_FROM_FN_PTR(address, object_reference_write_slow_call) || call == CAST_FROM_FN_PTR(address, object_reference_array_copy_pre_call) - || call == CAST_FROM_FN_PTR(address, object_reference_array_copy_post_call); + || call == CAST_FROM_FN_PTR(address, object_reference_array_copy_post_call) + || call == CAST_FROM_FN_PTR(address, load_reference_call); } /// Full pre-barrier @@ -87,6 +90,8 @@ class MMTkBarrierSetRuntime: public CHeapObj { virtual void object_reference_array_copy_pre(oop* src, oop* dst, size_t count) const {}; /// Full arraycopy post-barrier virtual void object_reference_array_copy_post(oop* src, oop* dst, size_t count) const {}; + /// java.lang.Reference load barrier + virtual void load_reference(DecoratorSet decorators, oop value) const {}; /// Called at the end of every C2 slowpath allocation. /// Deoptimization can happen after C2 slowpath allocation, and the newly allocated object can be promoted. /// So this callback is requierd for any generational collectors. @@ -173,6 +178,37 @@ class MMTkBarrierSet : public BarrierSet { private: typedef BarrierSet::AccessBarrier Raw; public: + // Needed for weak references + static oop oop_load_in_heap_at(oop base, ptrdiff_t offset) { + oop value = Raw::oop_load_in_heap_at(base, offset); + const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0; + const bool peek = (decorators & AS_NO_KEEPALIVE) != 0; + const bool needs_enqueue = (!peek && !on_strong_oop_ref); + if (needs_enqueue && value != NULL) { + runtime()->load_reference(decorators, value); + } + return value; + } + + template + static oop oop_load_not_in_heap(T* addr) { + oop value = Raw::template oop_load(addr); + const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0; + const bool peek = (decorators & AS_NO_KEEPALIVE) != 0; + const bool needs_enqueue = (!peek && !on_strong_oop_ref); + if (needs_enqueue && value != NULL) { + runtime()->load_reference(decorators, value); + } + return value; + } + + // Defensive: will catch weak oops at addresses in heap + template + static oop oop_load_in_heap(T* addr) { + UNREACHABLE(); + return NULL; + } + template static void oop_store_in_heap(T* addr, oop value) { UNREACHABLE(); diff --git a/openjdk/mmtkBarrierSetAssembler_x86.cpp b/openjdk/mmtkBarrierSetAssembler_x86.cpp index b79e821c..112cf97a 100644 --- a/openjdk/mmtkBarrierSetAssembler_x86.cpp +++ b/openjdk/mmtkBarrierSetAssembler_x86.cpp @@ -144,38 +144,28 @@ void MMTkBarrierSetAssembler::eden_allocate(MacroAssembler* masm, Register threa #define __ sasm-> -void MMTkBarrierSetAssembler::generate_c1_write_barrier_runtime_stub(StubAssembler* sasm) const { - __ prologue("mmtk_write_barrier", false); +void MMTkBarrierSetAssembler::generate_c1_ref_load_barrier_runtime_stub(StubAssembler* sasm) const { + __ prologue("mmtk_ref_load_barrier", false); - Address store_addr(rbp, 4*BytesPerWord); + // Address store_addr(rbp, 2*BytesPerWord); Label done, runtime; __ push(c_rarg0); - __ push(c_rarg1); - __ push(c_rarg2); __ push(rax); __ load_parameter(0, c_rarg0); - __ load_parameter(1, c_rarg1); - __ load_parameter(2, c_rarg2); __ bind(runtime); __ save_live_registers_no_oop_map(true); - if (mmtk_enable_barrier_fastpath) { - __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); - } else { - __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_post_call), 3); - } + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::load_reference_call), 1); __ restore_live_registers(true); __ bind(done); __ pop(rax); - __ pop(c_rarg2); - __ pop(c_rarg1); __ pop(c_rarg0); __ epilogue(); @@ -185,13 +175,18 @@ void MMTkBarrierSetAssembler::generate_c1_write_barrier_runtime_stub(StubAssembl #define __ ce->masm()-> -void MMTkBarrierSetAssembler::generate_c1_write_barrier_stub_call(LIR_Assembler* ce, MMTkC1BarrierStub* stub) { - MMTkBarrierSetC1* bs = (MMTkBarrierSetC1*) BarrierSet::barrier_set()->barrier_set_c1(); +void MMTkBarrierSetAssembler::generate_c1_ref_load_barrier_stub_call(LIR_Assembler* ce, MMTkC1ReferenceLoadBarrierStub* stub) { + MMTkBarrierSetC1* bs = (MMTkBarrierSetC1*)BarrierSet::barrier_set()->barrier_set_c1(); + __ bind(*stub->entry()); - ce->store_parameter(stub->src->as_pointer_register(), 0); - ce->store_parameter(stub->slot->as_pointer_register(), 1); - ce->store_parameter(stub->new_val->as_pointer_register(), 2); - __ call(RuntimeAddress(bs->_write_barrier_c1_runtime_code_blob->code_begin())); + assert(stub->val->is_register(), "Precondition."); + + Register val_reg = stub->val->as_register(); + + __ cmpptr(val_reg, (int32_t) NULL_WORD); + __ jcc(Assembler::equal, *stub->continuation()); + ce->store_parameter(stub->val->as_register(), 0); + __ call(RuntimeAddress(bs->_ref_load_barrier_c1_runtime_code_blob->code_begin())); __ jmp(*stub->continuation()); } diff --git a/openjdk/mmtkBarrierSetAssembler_x86.hpp b/openjdk/mmtkBarrierSetAssembler_x86.hpp index 383b688f..47bade05 100644 --- a/openjdk/mmtkBarrierSetAssembler_x86.hpp +++ b/openjdk/mmtkBarrierSetAssembler_x86.hpp @@ -5,7 +5,9 @@ #include "gc/shared/barrierSetAssembler.hpp" class MMTkBarrierSetC1; -class MMTkC1BarrierStub; +class MMTkC1PreBarrierStub; +class MMTkC1PostBarrierStub; +class MMTkC1ReferenceLoadBarrierStub; class LIR_Assembler; class StubAssembler; @@ -27,8 +29,11 @@ class MMTkBarrierSetAssembler: public BarrierSetAssembler { return !in_heap || (skip_const_null && val == noreg); } - /// Generate C1 write barrier slow-call assembly code - virtual void generate_c1_write_barrier_runtime_stub(StubAssembler* sasm) const; + /// Generate C1 pre write barrier slow-call assembly code + virtual void generate_c1_pre_write_barrier_runtime_stub(StubAssembler* sasm) const {}; + /// Generate C1 post write barrier slow-call assembly code + virtual void generate_c1_post_write_barrier_runtime_stub(StubAssembler* sasm) const {}; + virtual void generate_c1_ref_load_barrier_runtime_stub(StubAssembler* sasm) const; public: virtual void eden_allocate(MacroAssembler* masm, Register thread, Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Label& slow_case) override; @@ -41,6 +46,8 @@ class MMTkBarrierSetAssembler: public BarrierSetAssembler { } /// Generate C1 write barrier slow-call stub - static void generate_c1_write_barrier_stub_call(LIR_Assembler* ce, MMTkC1BarrierStub* stub); + virtual void generate_c1_pre_write_barrier_stub(LIR_Assembler* ce, MMTkC1PreBarrierStub* stub) const {}; + virtual void generate_c1_post_write_barrier_stub(LIR_Assembler* ce, MMTkC1PostBarrierStub* stub) const {}; + static void generate_c1_ref_load_barrier_stub_call(LIR_Assembler* ce, MMTkC1ReferenceLoadBarrierStub* stub); }; #endif // MMTK_OPENJDK_MMTK_BARRIER_SET_ASSEMBLER_X86_HPP diff --git a/openjdk/mmtkBarrierSetC1.cpp b/openjdk/mmtkBarrierSetC1.cpp index b2c9a683..09f6e469 100644 --- a/openjdk/mmtkBarrierSetC1.cpp +++ b/openjdk/mmtkBarrierSetC1.cpp @@ -4,18 +4,56 @@ #include "mmtkBarrierSetC1.hpp" void MMTkBarrierSetC1::generate_c1_runtime_stubs(BufferBlob* buffer_blob) { - class MMTkBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { + class MMTkPreBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { virtual OopMapSet* generate_code(StubAssembler* sasm) override { MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); - bs->generate_c1_write_barrier_runtime_stub(sasm); + bs->generate_c1_pre_write_barrier_runtime_stub(sasm); return NULL; } + public: + MMTkPreBarrierCodeGenClosure() {} }; - MMTkBarrierCodeGenClosure write_code_gen_cl; - _write_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "write_code_gen_cl", false, &write_code_gen_cl); + + class MMTkPostBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { + virtual OopMapSet* generate_code(StubAssembler* sasm) override { + MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); + bs->generate_c1_post_write_barrier_runtime_stub(sasm); + return NULL; + } + public: + MMTkPostBarrierCodeGenClosure() {} + }; + + MMTkPreBarrierCodeGenClosure pre_write_code_gen_cl; + _pre_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "mmtk_pre_write_code_gen_cl", false, &pre_write_code_gen_cl); + MMTkPostBarrierCodeGenClosure post_write_code_gen_cl; + _post_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "mmtk_post_write_code_gen_cl", false, &post_write_code_gen_cl); + // MMTkBarrierCodeGenClosure write_code_gen_cl_patch_fix(true); + // _write_barrier_c1_runtime_code_blob_with_patch_fix = Runtime1::generate_blob(buffer_blob, -1, "write_code_gen_cl_patch_fix", false, &write_code_gen_cl_patch_fix); + + class MMTkRefLoadBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { + virtual OopMapSet* generate_code(StubAssembler* sasm) override { + MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); + bs->generate_c1_ref_load_barrier_runtime_stub(sasm); + return NULL; + } + }; + + MMTkRefLoadBarrierCodeGenClosure load_code_gen_cl; + _ref_load_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "load_code_gen_cl", false, &load_code_gen_cl); +} + +void MMTkC1PostBarrierStub::emit_code(LIR_Assembler* ce) { + MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); + bs->generate_c1_post_write_barrier_stub(ce, this); +} + +void MMTkC1PreBarrierStub::emit_code(LIR_Assembler* ce) { + MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); + bs->generate_c1_pre_write_barrier_stub(ce, this); } -void MMTkC1BarrierStub::emit_code(LIR_Assembler* ce) { +void MMTkC1ReferenceLoadBarrierStub::emit_code(LIR_Assembler* ce) { MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); - bs->generate_c1_write_barrier_stub_call(ce, this); + bs->generate_c1_ref_load_barrier_stub_call(ce, this); } diff --git a/openjdk/mmtkBarrierSetC1.hpp b/openjdk/mmtkBarrierSetC1.hpp index dea0712e..8d65b6b3 100644 --- a/openjdk/mmtkBarrierSetC1.hpp +++ b/openjdk/mmtkBarrierSetC1.hpp @@ -10,23 +10,25 @@ class MMTkBarrierSetC1 : public BarrierSetC1 { friend class MMTkBarrierSetAssembler; protected: - CodeBlob* _write_barrier_c1_runtime_code_blob; + CodeBlob* _pre_barrier_c1_runtime_code_blob; + CodeBlob* _post_barrier_c1_runtime_code_blob; + CodeBlob* _ref_load_barrier_c1_runtime_code_blob; /// Full pre-barrier - virtual void object_reference_write_pre(LIRAccess& access, LIR_Opr src, LIR_Opr slot, LIR_Opr new_val) const {} + virtual void object_reference_write_pre(LIRAccess& access, LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* info) const {} /// Full post-barrier virtual void object_reference_write_post(LIRAccess& access, LIR_Opr src, LIR_Opr slot, LIR_Opr new_val) const {} /// Substituting write barrier virtual void store_at_resolved(LIRAccess& access, LIR_Opr value) override { - if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), value); + if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), value, access.patch_emit_info()); BarrierSetC1::store_at_resolved(access, value); if (access.is_oop()) object_reference_write_post(access, access.base().opr(), access.resolved_addr(), value); } /// Substituting write barrier (cmpxchg) virtual LIR_Opr atomic_cmpxchg_at_resolved(LIRAccess& access, LIRItem& cmp_value, LIRItem& new_value) override { - if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), new_value.result()); + if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), new_value.result(), NULL); LIR_Opr result = BarrierSetC1::atomic_cmpxchg_at_resolved(access, cmp_value, new_value); if (access.is_oop()) object_reference_write_post(access, access.base().opr(), access.resolved_addr(), new_value.result()); return result; @@ -34,7 +36,7 @@ class MMTkBarrierSetC1 : public BarrierSetC1 { /// Substituting write barrier (xchg) virtual LIR_Opr atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value) override { - if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), value.result()); + if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), value.result(), NULL); LIR_Opr result = BarrierSetC1::atomic_xchg_at_resolved(access, value); if (access.is_oop()) object_reference_write_post(access, access.base().opr(), access.resolved_addr(), value.result()); return result; @@ -58,19 +60,55 @@ class MMTkBarrierSetC1 : public BarrierSetC1 { public: - MMTkBarrierSetC1() {} + MMTkBarrierSetC1() + : _pre_barrier_c1_runtime_code_blob(NULL), + _post_barrier_c1_runtime_code_blob(NULL) {} + + CodeBlob* pre_barrier_c1_runtime_code_blob() { return _pre_barrier_c1_runtime_code_blob; } + CodeBlob* post_barrier_c1_runtime_code_blob() { return _post_barrier_c1_runtime_code_blob; } /// Generate C1 write barrier slow-call C1-LIR code virtual void generate_c1_runtime_stubs(BufferBlob* buffer_blob) override; }; -/// C1 write barrier slow-call stub. +/// C1 pre write barrier slow-call stub. +/// The default behaviour is to call `MMTkBarrierSetRuntime::object_reference_write_pre_call` and pass all the three args. +/// Barrier implementations may inherit from this class, and override `emit_code` to perform a specialized slow-path call. +struct MMTkC1PreBarrierStub: CodeStub { + LIR_Opr src, slot, new_val; + CodeEmitInfo* info; // Code patching info + LIR_PatchCode patch_code; // Enable code patching? + LIR_Opr scratch = NULL; // Scratch register for the resolved field + + MMTkC1PreBarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none): src(src), slot(slot), new_val(new_val), info(info), patch_code(patch_code) {} + + virtual void emit_code(LIR_Assembler* ce) override; + + virtual void visit(LIR_OpVisitState* visitor) override { + if (info != NULL) { + visitor->do_slow_case(info); + } else { + visitor->do_slow_case(); + } + if (src != NULL) visitor->do_input(src); + if (slot != NULL) visitor->do_input(slot); + if (new_val != NULL) visitor->do_input(new_val); + if (scratch != NULL) { + assert(scratch->is_oop(), "must be"); + visitor->do_temp(scratch); + } + } + + NOT_PRODUCT(virtual void print_name(outputStream* out) const { out->print("MMTkC1PreBarrierStub"); }); +}; + +/// C1 post write barrier slow-call stub. /// The default behaviour is to call `MMTkBarrierSetRuntime::object_reference_write_post_call` and pass all the three args. /// Barrier implementations may inherit from this class, and override `emit_code` to perform a specialized slow-path call. -struct MMTkC1BarrierStub: CodeStub { +struct MMTkC1PostBarrierStub: CodeStub { LIR_Opr src, slot, new_val; - MMTkC1BarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val): src(src), slot(slot), new_val(new_val) {} + MMTkC1PostBarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val): src(src), slot(slot), new_val(new_val) {} virtual void emit_code(LIR_Assembler* ce) override; @@ -81,7 +119,27 @@ struct MMTkC1BarrierStub: CodeStub { if (new_val != NULL) visitor->do_input(new_val); } - NOT_PRODUCT(virtual void print_name(outputStream* out) const { out->print("MMTkC1BarrierStub"); }); + NOT_PRODUCT(virtual void print_name(outputStream* out) const { out->print("MMTkC1PostBarrierStub"); }); +}; + +struct MMTkC1ReferenceLoadBarrierStub: CodeStub { + LIR_Opr val; + CodeEmitInfo* info; // Code patching info + + MMTkC1ReferenceLoadBarrierStub(LIR_Opr val, CodeEmitInfo* info = NULL): val(val), info(info) {} + + virtual void emit_code(LIR_Assembler* ce) override; + + virtual void visit(LIR_OpVisitState* visitor) override { + if (info != NULL) { + visitor->do_slow_case(info); + } else { + visitor->do_slow_case(); + } + if (val != NULL) visitor->do_input(val); + } + + NOT_PRODUCT(virtual void print_name(outputStream* out) const { out->print("MMTkC1ReferenceLoadBarrierStub"); }); }; #endif // MMTK_OPENJDK_MMTK_BARRIER_SET_C1_HPP