RFR: JDK-8310316: Failing HotSpot Compiler directives are too verbose
Daniel D. Daugherty
dcubed at openjdk.org
Fri Jul 21 16:17:44 UTC 2023
On Thu, 20 Jul 2023 15:04:28 GMT, Eric Nothum <duke at openjdk.org> wrote:
> Previously jcmd printed the whole file if a compiler directive was added that was not in json format. This example illustrates the issue:
>
>
> ./jcmd 331311 Compiler.directives_add ./example.txt
> 331311:
> Syntax error on line 1 byte 1: Json must start with an object or an array.
> At 'This'.
> This is my very interesting text,
> followed by some more exciting text.
>
> Parsing of compiler directives failed
> Could not load file: ./example.txt
>
> The json error message is not printed if the silent field is set in the `DirectivesParser` object.
> The proposed change adds a boolean parameter silent that is propagated from `CompilerDirectivesAddDCmd::execute` to the `DirectivesParser` constructor. The default value for the new parameter is set to false, which represents the original behavior. In case where a compiler directive is added, the parameter is set to true and the error message will be reduced.
>
> The proposed change reduces the error message to:
>
>
> ./jcmd 335703 Compiler.directives_add ./example.txt
> 335703:
> Parsing of compiler directives failed
> Could not load file: ./example.txt
Redirecting to the proper label:
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14957#issuecomment-1645881127
More information about the hotspot-compiler-dev
mailing list