Way to print type inference engine progress?

Cesar Soares Lucas Divino.Cesar at microsoft.com
Tue Feb 2 23:22:42 UTC 2021


Thank you, Maurizio. That was helpful!
________________________________
From: Maurizio Cimadamore <maurizio.cimadamore at oracle.com>
Sent: February 2, 2021 3:10 AM
To: Cesar Soares Lucas <Divino.Cesar at microsoft.com>; compiler-dev at openjdk.java.net <compiler-dev at openjdk.java.net>
Subject: Re: Way to print type inference engine progress?

Hi Cesar,
There should be an option:

"-Ddebug.dumpInferenceGraphsTo=<folder-name>"

which should generate a lot of .dot files showing constraints and
dependencies between inference variables. The option generates a ton of
output though, so it might take a while to figure out what graph you are
staring at.

Cheers
Maurizio

On 02/02/2021 01:31, Cesar Soares Lucas wrote:
> Hey there,
>
> I'm debugging a portion of Java 11 code that seems to be hitting a problem like the bugs reported here [1][2]. I'm not very familiar with javac internals so I'm wondering if there is a way to make the type inference engine operate in verbose mode so I can get a list of type/constraints that it resolved during the evaluation of a Java statement.
>
> I have a piece of code similar to the one below and I wanted to see all types the engine considered for each method:
>
> Workflow<Map<FeatureSourceKey, Document<?>>> result = Workflow
>      .value(strs)
>      .flatMap(operator)
>      .map(
>          batchResult -> batchResult
>          .values()
>          .stream()
>          .map(item -> getReMixBulkResponseItemValue(item))
>          .collect(Collectors.toMap(d -> null, Function.identity())));
>
> Is this possible?
>
>
> Thanks,
> Cesar
>
> [1] https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.openjdk.java.net%2Fbrowse%2FJDK-8222171&data=04%7C01%7CDivino.Cesar%40microsoft.com%7C08cccf30a24348ec144508d8c76b69a3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637478611436273106%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Vetuhk1Rhps%2BPll6xN9BcqRcdm35BRQVHfcuEk5l0t8%3D&reserved=0
> [2] https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.openjdk.java.net%2Fbrowse%2FJDK-8222035&data=04%7C01%7CDivino.Cesar%40microsoft.com%7C08cccf30a24348ec144508d8c76b69a3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637478611436273106%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=oEGyG%2FY2fn2oFtn3cAnh%2FWPdpsHd47Zme1TGCGOGC9E%3D&reserved=0


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20210202/3dc0039a/attachment-0001.htm>


More information about the compiler-dev mailing list