RFR: 8271461: CompileCommand support for hidden class methods [v4]

Jie Fu jiefu at openjdk.java.net
Wed Aug 4 04:25:30 UTC 2021


On Wed, 4 Aug 2021 03:00:40 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> > > It still appears to apply to package names, not just class names.
> > 
> > 
> > `is_hidden_calss_pattern` will check whether '*' is followed by "::" so cases like `java.util/*.ResourceBundle$$Lambda$1/0x<digits>::method` won't be detected as hidden class pattern. @dean-long
> 
> You also need this test case: `java.util/*::method`. It should be disallowed. Otherwise it will be transformed to `java.util+*::method`. (But I think you current code allows it).
> 
> I have the feeling that we are unnecessarily complicating the VM simply because PrintCompilation prints out `/`.


Yes, I think we've over engineered this issue.


I have no idea how to exclude cases like `java.util/*::method` while supporting cases like `java.util.ResourceBundle$$Lambda$1/*::method`.

But does it really matter if cases like `java.util/*::method` are disallowed or harmlessly false recognized as hidden class patterns?

Before this change, `java.util/*::method` is disallowed, so there is no effect to the compilers.
After this change, `java.util/*::method` would be allowed and replaced to `java.util+*::method`.
But since there are no methods matched with `java.util+*::method`, so there is actually no effect to the compilers.

That's why I said there may be false positive cases, but they are actually harmless at the very beginning.

If `java.util/*::method` must be disallowed for CompileCommand, then I would ask shall we also disallow `java.util.*:::method`?

My test shows that `java.util.*:::method` is actually allowed by CompileCommand.

java -XX:CompileCommand=exclude,'java.util.*:::method' -version
CompileCommand: exclude java/util/*.method bool exclude = true
openjdk version "18-internal" 2022-03-15
OpenJDK Runtime Environment (fastdebug build 18-internal+0-adhoc.fool.jdk)
OpenJDK 64-Bit Server VM (fastdebug build 18-internal+0-adhoc.fool.jdk, mixed mode)


> Why don't we change PrintCompilation to print out `+` instead?
> 

That's not what I want since both the java docs and your example say that there is a '/' in hidden class name.
Thanks.

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

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


More information about the hotspot-compiler-dev mailing list