RFR: 8310355: Move the stub test from initialize_final_stubs() to test/hotspot/gtest

Hao Sun haosun at openjdk.org
Tue Jul 4 04:53:11 UTC 2023


Three groups of runtime routines, i.e. arraycopy, copy and fill, are tested inside function `initialize_final_stubs()`. The test runs every time the debug VM is started.

I think it's a usual convention that it's better not to run functional tests on startup. Hence, this patch proposes to move the stub test under `test/hotspot/gtest`.

It's one copy-paste patch, except the following two minor changes:

1) Remove `ASSERT` condition check, and the gtest case will be run for release build as well.

2) Use the gtest helper `ASSERT_TRUE()` to replace the `assert()`.

Note that the downside is that we won't catch stub implementation errors immediately on startup.

Test:

1) Cross compilations on arm32/s390/ppc/riscv passed.

2) tier1 test passed on Linux/AArch64, Linux/x86_64 and macOS/Apple silicon. Note that hotspot/gtest is run in tier1.

3) VM builds with several different options (e.g., zero build, release build, fastdebug build, client variant, no C1/c2) passed on Linux/AArch64 and Linux/x86_64.

4) I manually injected errors in arraycopy/copy/fill stubs and verified `make test TEST="gtest:StubRoutines"` fails or not. But this check only worked for array fill stub. For the remaining two stubs, VM build (`make images`) failed firstly before running the gtest, because the built VM with these "erroneous" stubs were executed to do something such as loading Java core library code.

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

Commit messages:
 - 8310355: Move the stub test from initialize_final_stubs() to test/hotspot/gtest

Changes: https://git.openjdk.org/jdk/pull/14765/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14765&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8310355
  Stats: 272 lines in 2 files changed: 153 ins; 119 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/14765.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14765/head:pull/14765

PR: https://git.openjdk.org/jdk/pull/14765


More information about the hotspot-dev mailing list