675 ZERO_OBJECT = IMPL_LOOKUP.findStatic(THIS_CLASS, "zeroObject", zeroObjectType); |
675 ZERO_OBJECT = IMPL_LOOKUP.findStatic(THIS_CLASS, "zeroObject", zeroObjectType); |
676 IGNORE = IMPL_LOOKUP.findStatic(THIS_CLASS, "ignore", ignoreType); |
676 IGNORE = IMPL_LOOKUP.findStatic(THIS_CLASS, "ignore", ignoreType); |
677 EMPTY = IMPL_LOOKUP.findStatic(THIS_CLASS, "empty", ignoreType.dropParameterTypes(0, 1)); |
677 EMPTY = IMPL_LOOKUP.findStatic(THIS_CLASS, "empty", ignoreType.dropParameterTypes(0, 1)); |
678 NEW_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "newArray", MethodType.methodType(Object[].class, int.class)); |
678 NEW_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "newArray", MethodType.methodType(Object[].class, int.class)); |
679 } catch (NoSuchMethodException | IllegalAccessException ex) { |
679 } catch (NoSuchMethodException | IllegalAccessException ex) { |
680 Error err = new InternalError("uncaught exception"); |
680 throw new InternalError("uncaught exception", ex); |
681 err.initCause(ex); |
|
682 throw err; |
|
683 } |
681 } |
684 } |
682 } |
685 |
683 |
686 // Varargs methods need to be in a separately initialized class, to bootstrapping problems. |
684 // Varargs methods need to be in a separately initialized class, to bootstrapping problems. |
687 static class LazyStatics { |
685 static class LazyStatics { |
691 //MAKE_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "makeArray", MethodType.methodType(Object[].class, Object[].class)); |
689 //MAKE_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "makeArray", MethodType.methodType(Object[].class, Object[].class)); |
692 COPY_AS_REFERENCE_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "copyAsReferenceArray", MethodType.methodType(Object[].class, Class.class, Object[].class)); |
690 COPY_AS_REFERENCE_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "copyAsReferenceArray", MethodType.methodType(Object[].class, Class.class, Object[].class)); |
693 COPY_AS_PRIMITIVE_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "copyAsPrimitiveArray", MethodType.methodType(Object.class, Wrapper.class, Object[].class)); |
691 COPY_AS_PRIMITIVE_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "copyAsPrimitiveArray", MethodType.methodType(Object.class, Wrapper.class, Object[].class)); |
694 MAKE_LIST = IMPL_LOOKUP.findStatic(THIS_CLASS, "makeList", MethodType.methodType(List.class, Object[].class)); |
692 MAKE_LIST = IMPL_LOOKUP.findStatic(THIS_CLASS, "makeList", MethodType.methodType(List.class, Object[].class)); |
695 } catch (ReflectiveOperationException ex) { |
693 } catch (ReflectiveOperationException ex) { |
696 Error err = new InternalError("uncaught exception"); |
694 throw new InternalError("uncaught exception", ex); |
697 err.initCause(ex); |
|
698 throw err; |
|
699 } |
695 } |
700 } |
696 } |
701 } |
697 } |
702 |
698 |
703 private static final EnumMap<Wrapper, MethodHandle>[] WRAPPER_CASTS |
699 private static final EnumMap<Wrapper, MethodHandle>[] WRAPPER_CASTS |