使用UnSafe提升抛异常提升性能

82 阅读1分钟

io.netty.util.internal.PlatformDependent0#throwException

static void throwException(Throwable cause) {
    // JVM has been observed to crash when passing a null argument. See https://github.com/netty/netty/issues/4131.
    UNSAFE.throwException(checkNotNull(cause, "cause"));
}