What are the preliminary highlighted jvm exceptions?

I see links to pre-highlighted JVM exceptions: - http://www.oracle.com/technetwork/java/javase/relnotes-139183.html - http://dev.clojure.org/display/community/Project+Ideas+ 2016

But looking at this, I see only information about the missing stacks. What are JVM exceptions? This is like optimization.

How does it work and what are the trade-offs?

+4
source share
2 answers

These are exceptions that are pre-distributed at the beginning of the JVM. Pre-selected exceptions should be implicit : they are generated by the JVM, and not throw new ...when an unexpected condition occurs: dereferencing a null pointer, accessing an array with a negative index, etc.

When a method starts throwing too often (implicitly) one of these exceptions, the JVM notices this and replaces the throwing of the exception with each throw, throwing an already thrown exception without stacktrace.

This mechanism is implementation dependent, so if we are talking about a hot spot, you can find a list of these exceptions in graphKit.cpp :

NullPointerException 
ArithmeticException
ArrayIndexOutOfBoundsException
ArrayStoreException
ClassCastException

: - , ( Throwable#fillInStackTrace)., , hotspot .

(, ) ( , , . this ), hotspot [, ] , stacktrace ( ).

, stacktraceless. : , , , . , . , -XX:-OmitStackTraceInFastThrow

+7

, , :

: " " " . , , . , ."

, .

, .

, , .

, -XX:-OmitStackTraceInFastThrow

+2

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


All Articles