上QQ阅读APP看书,第一时间看更新
New in Java 9
With the changes to the modern Java platform, a critical section will automatically be given additional space so that it can complete its execution and not suffer from StackOverflowError. This is predicated on the additional space allocation needs being small. The necessary changes have been made to the JVM to permit this functionality.
The JVM actually delays StackOverflowError, or at least attempts to, while critical sections are executing. In order to capitalize on this new schema, methods must be annotated with the following:
jdk.internal.vm.annotation.ReservedStackAccess
When a method has this annotation and a StackOverflowError condition exists, temporary access to the reserved memory space is granted. The new process is, at a high-level of abstraction, presented as follows: