RFR: 8324641: [IR Framework] Add Setup method to provide custom arguments and set fields [v16]
Emanuel Peter
epeter at openjdk.org
Wed Feb 7 17:02:35 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 incrementally with two additional commits since the last revision:
- remove tabs
- improved and simplified examples
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/17557/files
- new: https://git.openjdk.org/jdk/pull/17557/files/4a8f96b9..33029f68
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=17557&range=15
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=17557&range=14-15
Stats: 94 lines in 2 files changed: 50 ins; 6 del; 38 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