JDK-8256508 : Improve CompileCommand flag
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-11-17
  • Updated: 2021-02-26
  • Resolved: 2020-11-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b27Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8263032 :  
Description
The current implementation of compile command has two types of options. Types pre-defined options like "compileonly" and the general 'option' type.

'option'-type are not defined, they can accidentally be used with the wrong value type, and the syntax is error prone.

By pre-defining all compile commands used and giving them types the parsing can be simplified, proper parsing errors can be given and and reasonable syntax can be used.

This:
-XX:CompileCommand=option,java/util/String.toString,int,RepeatCompilation,5

Is superseded by:
-XX:CompileCommand=RepeatCompilation,java/util/String.toString,5

Attention check: Did you spot the error in the old command?

In order not to break anything - the old syntax is kept for now. But even the old command format is improved with verification for  the option name and the type of the value.




Comments
Changeset: cfb175df Author: Nils Eliasson <neliasso@openjdk.org> Date: 2020-11-25 14:20:35 +0000 URL: https://github.com/openjdk/jdk/commit/cfb175df
25-11-2020

This is the new help text: The CompileCommand option enables the user of the JVM to control specific behavior of the dynamic compilers. Compile commands has this general form: -XX:CompileCommand=<option><method pattern><value> Sets <option> to the specified value for methods matching <method pattern> All options are typed -XX:CompileCommand=<option><method pattern> Sets <option> to true for methods matching <method pattern> Only applies to boolean options. -XX:CompileCommand=quiet Silence the compile command output -XX:CompileCommand=help Prints this help text All available options: log (bool) print (bool) inline (bool) dontinline (bool) compileonly (bool) exclude (bool) break (bool) BreakAtExecute (bool) BreakAtCompile (bool) PrintAssembly (bool) PrintInlining (bool) PrintIntrinsics (bool) PrintNMethods (bool) PrintOptoAssembly (bool) PrintDebugInfo (bool) PrintRelocations (bool) PrintDependencies (bool) BackgroundCompilation (bool) RepeatCompilation (intx) ReplayInline (bool) DumpReplay (bool) DumpInline (bool) CompileThresholdScaling (double) ControlIntrinsic (ccstrlist) DisableIntrinsic (ccstrlist) NoRTMLockEliding (bool) UseRTMLockEliding (bool) BlockLayoutByFrequency (bool) TraceOptoPipelining (bool) TraceOptoOutput (bool) TraceSpilling (bool) PrintIdeal (bool) IGVPrintLevel (intx) Vectorize (bool) VectorizeDebug (uintx) CloneMapDebug (bool) MaxNodeLimit (intx) TestOptionInt (intx) TestOptionUint (uintx) TestOptionBool (bool) TestOptionBool2 (bool) TestOptionStr (ccstr) TestOptionList (ccstrlist) TestOptionDouble (double) Method patterns has the format: package/Class.method() For backward compatibility this form is also allowed: package.Class::method() The signature can be separated by an optional whitespace or comma: package/Class.method () The class and method identifier can be used together with leading or trailing *'s for wildcard matching: *ackage/Clas*.*etho*() It is possible to use more than one CompileCommand on the command line: -XX:CompileCommand=exclude,java/*.* -XX:CompileCommand=log,java*.* The CompileCommands can be loaded from a file with the flag -XX:CompileCommandFile=<file> or be added to the file '.hotspot_compiler' Use the same format in the file as the argument to the CompileCommand flag. Add one command on each line. exclude java/*.* option java/*.* ReplayInline The following commands have conflicting behavior: 'exclude', 'inline', 'dontinline', and 'compileonly'. There is no priority of commands. Applying (a subset of) these commands to the same method results in undefined behavior.
17-11-2020