Can optimizing JIT Hotspot for quick throw exceptions produce mixed results?

This question concerns cases where the JIT compiler determines that it will no longer generate stop traces if it considers that it has done this a number of times earlier. I understand that this is known as a “quick throw” or “prevailing” exception.

Generally speaking, if someone encounters such a predefined exception, the missing glass should be searched at least once at some earlier point in the life of the JVM before the JIT considers it worth compiling.

My question is whether it can guarantee that the mapping back from the reported occurrence of the previously highlighted exception to at least one instance of the earlier exception can be deterministic, and if not, is there a way to avoid this, which is a source of ambiguity, to disable optimization in general with using -XX: -OmitStackTraceInFastThrow.

The simplest example:

The abbreviated / pre-thrown exception that the message receives is something common, such as a NullPointerException. If there was only one stacktrace type with NPE in the previous JVM period, then there is no problem. But what if there was already more than one NPE from different points in the code? The JVM does not give any indications which, or if any of the previous stacks were compiled, since you could deterministically establish what the glass frame would otherwise be?

Can this circumstance really arise, or is the modern Hotspot JIT smart enough to avoid creating such ambiguity?

+4
source share
1 answer

JVM . , , , , .

- stacktrace-less, - -XX:-OmitStackTraceInFastThrow, .

+4

Source: https://habr.com/ru/post/1612460/


All Articles