Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8351362

Post-process @Strict annotation for testing

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • repo-valhalla
    • hotspot

      We need test infrastructure for Valhalla HotSpot tests that does the following:

      - Introduce a `@Strict` annotation (within the test space, *not* the same thing as `jdk.internal.vm.annotation.Strict`, which we can eventually garbage-collect)

      - Pre-process classes to spot uses of `@Strict` applied to a field

      - Where identified, rewrite that field's flags to set ACC_STRICT (0x0800)

      - Inspect the <init> methods of these classes, and if strict fields are left uninitialized before the javac-generated 'super()' call, move the 'super()' call to the end, immediately before 'return'

      - Regenerate the StackMapTable of each <init> method, as needed, to indicate larval stack frames where the field has been set

      - Adjust the class file version number, if necessary

      With these changes, update all tests that use `jdk.internal.vm.annotation.Strict` today so that they:

      - Use the test annotation instead
      - Invoke the class pre-processor as part of the compilation step

      The class files used to run these tests should be mostly identical to the ones that are generated today, just produced with different tooling.

            liach Chen Liang
            dlsmith Dan Smith
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: