RFR: 8324641: [IR Framework] Add Setup method to provide custom arguments and set fields [v7]

Emanuel Peter epeter at openjdk.org
Tue Feb 6 11:14:15 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:

 - fix whitespace from last commit
 - Apply suggestions from code review
   
   Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/17557/files
  - new: https://git.openjdk.org/jdk/pull/17557/files/8ff7dfac..164665fa

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17557&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17557&range=05-06

  Stats: 7 lines in 3 files changed: 1 ins; 0 del; 6 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