RFR(S): 8247732: validate user-input intrinsic_ids in ControlIntrinsic

Liu, Xin xxinliu at amazon.com
Wed Jul 8 08:26:01 UTC 2020


hi, Reviewers,

Please allow me to ping this CR.
It's the last left-over task for -XX:ControlIntrinsic=. it adds a sanity check for user-input.

Thanks,
--lx

On 6/25/20 6:59 PM, Liu, Xin wrote:

hi, Reviewers,

Could you review this patch?

bug: https://bugs.openjdk.java.net/browse/JDK-8247732

webrev: http://cr.openjdk.java.net/~xliu/8247732/00/webrev/


The core logic is class ControlIntrinsicValidator in compilerDirectives.hpp

It iterates the ccstrlist option and makes sure user-input intrinsic ids are all valid.  It stops and take a record when it meets the first unrecognized intrinsic.

I used constraints to validate the global options ControlIntrinsic and DisableIntrinsic.

ControlIntrinsic/DisableIntrinsic in compiler directives are more complex. The matched directive is only parsed when hotspot attempts to compile the corresponding method.

I validate at that time and JVM will crash if it doesnot meet guarantee() statement.

I added Method::external_name_short() which only returns the shorter method name in the form of  "classname::method".

Probably hotspot has had similar code, but I failed to discover. please let me know and I will remove it.


Test:

passed hotspot:tier1 and gtest:all

manually tests with wrong inputs.

https://bugs.openjdk.java.net/browse/JDK-8247732?focusedCommentId=14349960&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14349960





More information about the hotspot-compiler-dev mailing list