Other |
---|
tbdUnresolved |
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
If running with -XX:+OmitStackTraceInFastThrow (which is the default) C2 will optimize certain "hot" implicit exceptions (i.e. AIOOBE, NullPointerExceptions,..) and replace them by a static, pre-allocated exception without any stacktrace. However, we can actually do better. Instead of using a single, pre-allocated exception object for all method we can let the compiler allocate specific exceptions for each method and fill them with at least one stack frame with the method /line-number information of the currently compiled method. If the method in question is being inlined, we can add stackframes for all callers up to the inlining depth of the method in question. This optimization comes at no run-time costs because all the extra work will be done at compile time.
|