RFR: 8277102: Dubious PrintCompilation output

Tobias Hartmann thartmann at openjdk.java.net
Thu Nov 18 10:51:44 UTC 2021


On Thu, 18 Nov 2021 10:07:29 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java line 112:
>> 
>>> 110:         // Compiled method (c2)     310  463       4       compiler.jvmci.compilerToVM.CompileCodeTestCase$Dummy::staticMethod (1 bytes)
>>> 111:         for (int i = 2; i < str2Lines.length; i++) {
>>> 112:             Asserts.assertEQ(str2Lines[i], str3Lines[i],
>> 
>> Splitting the entire string by lines seems like a bit of an overhead. What about something like that (not tested)?
>> 
>> int idx = str2.indexOf(System.lineSeparator());
>> idx = str2.indexOf(System.lineSeparator(), idx + 1);
>> str2 = str2.substring(idx + 1);
>
> Doing it by lines will actually provide a more focused error message if there's a problem and I cannot image the overhead matters for a test like this.

Right, good point.

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

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


More information about the hotspot-compiler-dev mailing list