RFR: 8275908: Record null_check traps for calls and array_check traps in the interpreter

Volker Simonis simonis at openjdk.java.net
Thu Nov 25 10:57:11 UTC 2021


On Thu, 25 Nov 2021 09:12:42 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> `null_checks` occurring at invoke bytecodes are currently not recorded by the profiler. This leads to unnecessary uncommon traps, deoptimizations and recompilations for exceptions which already occurred before the compilation (i.e. are "hot"). This change fixes the problem in the interpreter.
>> 
>> `array_checks` are currently recorded as `class_checks` in the interpreter and therefore not recognized by the compiler. This again leads to uncommon traps, deoptimizations and recompilations. This change unifies the handling of `array_checks` in the interpreter and compiler and prevents unnecessary recompilation.
>> 
>> The test is a stripped down version of a test which was developed for [JDK-8273563: Improve performance of implicit exceptions with -XX:-OmitStackTraceInFastThrow](https://bugs.openjdk.java.net/browse/JDK-8273563) (still [under review](https://github.com/openjdk/jdk/pull/5488)). It introduces an extension to the Whitebox API to expose the decompile, deopt and trap counters which is also required for testing [JDK-8273563](https://bugs.openjdk.java.net/browse/JDK-8273563). I think (and hope) it will also be helpful for others in the future.
>
> src/hotspot/share/interpreter/interpreterRuntime.cpp line 834:
> 
>> 832:                                  THREAD);
>> 833: 
>> 834:     if(HAS_PENDING_EXCEPTION) {
> 
> Missing space

Fixed

> src/hotspot/share/opto/parseHelper.cpp line 301:
> 
>> 299: 
>> 300: #endif
>> 301: 
> 
> This line was probably deleted by mistake?

The line was actually deleted by my editor. I first wondered myself, but the file had an extra empty line et the end which I think we discourage. So at the end I think my editor was right :)
But as there remained no other changes in that file except the deleted empty line I agree that it looks strange now and I'll restore the file to its initial state.

> src/hotspot/share/runtime/deoptimization.hpp line 436:
> 
>> 434: 
>> 435:   static jint total_deoptimization_count();
>> 436:   static jint deoptimization_count(const char *reason_str, const char *action_str);
> 
> Nit: Asterisk should be at the type: `const char* reason_str`

Fixed

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

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


More information about the hotspot-dev mailing list