RFR: 8324641: [IR Framework] Add Setup method to provide custom arguments and set fields [v20]
Emanuel Peter
epeter at openjdk.org
Thu Feb 8 16:58:51 UTC 2024
> **Bigger goal**
>
> I am tired of always writing IR tests where I have to write elaborate code in the `@Run` method to create inputs, and then run the test method to create `gold` output values in (hopefully) interpreter mode, and then later verify the results of the compiled method.
>
> Hence, I now introduce the "Setup" method, which can create custom argument values.
> In a later RFE, I will implement automatic result verification, which implicitly intercepts the inputs and outputs of the test method, and compares the behaviour of the interpreter and the compiled code. That way, the pattern will be:
>
>
> @Setup
> ... specify your arguments and fields ...
>
> -> intercept arguments, cache them
>
> @Test
> ... write a test with arbitrary inputs and outputs...
>
> -> interpreter mode: intercept outputs and cache them (i.e. gold values)
> -> compiled mode: intercept outputs and compare them to the gold values.
>
> (optional)
> @Check
> .. do custom verification...
>
>
> **In this RFE: the Setup Method**
>
> The first step is the setup method.
>
> Example:
> https://github.com/openjdk/jdk/blob/08670a5d45b1c45e954e2dc85eb8c92e11e48fb2/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/SetupExample.java#L49-L87
Emanuel Peter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 38 additional commits since the last revision:
- Merge branch 'master' into JDK-8324641
- Merge branch 'master' into JDK-8324641
- fix whitespace
- more for Christian
- Apply suggestions from code review
thanks Christian!
Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
- remove tabs
- improved and simplified examples
- wip: throw tests, array tests, random tests
- wip: test fields and invocationCounter
- wip: more tests and fixes
- ... and 28 more: https://git.openjdk.org/jdk/compare/c81551a3...1f7872ad
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/17557/files
- new: https://git.openjdk.org/jdk/pull/17557/files/617e40a1..1f7872ad
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=17557&range=19
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=17557&range=18-19
Stats: 30981 lines in 1723 files changed: 14830 ins; 3900 del; 12251 mod
Patch: https://git.openjdk.org/jdk/pull/17557.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17557/head:pull/17557
PR: https://git.openjdk.org/jdk/pull/17557
More information about the hotspot-compiler-dev
mailing list