RFR: 8252916: Newline in object field values list of ScopeDesc should be removed

Tobias Hartmann thartmann at openjdk.java.net
Tue Sep 8 14:13:44 UTC 2020


Given the following test:

public class Test {

    static class MyClass {
        Object o1 = null;
        Object o2 = new Integer(42);
    }

    static Object test(boolean trap) {
        MyClass obj = new MyClass();
        if (trap) { }
        return obj.o1;
    }

    public static void main(String[] args) {
        for (int i = 0; i < 100_000; ++i) {
            test(false);
        }
    }
}

The ScopeDesc for the uncommon trap in C2 compiled 'test' is printed like this:

ScopeDesc(pc=0x00007f52a5160144 offset=84):
   Test::test at 9 (line 11) reexecute=true
   Locals
    - l0: empty
    - l1: obj[52]
   Expression stack
    - @0: reg rbp [10],int
   Objects
    - 52: Test$MyClass NULL
, stack[0],oop

There should be no newline after "NULL".

This is a regression from [JDK-8202171](https://bugs.openjdk.java.net/browse/JDK-8202171) in JDK 12. The fix is to no
print a new line in to be consistent with 'print_value_on'.

Thanks,
Tobias

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

Commit messages:
 - 8252916: Newline in object field values list of ScopeDesc should be removed

Changes: https://git.openjdk.java.net/jdk/pull/75/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=75&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8252916
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/75.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/75/head:pull/75

PR: https://git.openjdk.java.net/jdk/pull/75


More information about the hotspot-compiler-dev mailing list