< prev index next >

src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java

Print this page
*** 1456,24 ***
              @Override
              public Map<String, byte[]> generateHolderClasses(Stream<String> traces) {
                  return GenerateJLIClassesHelper.generateHolderClasses(traces);
              }
  
-             @Override
-             public void ensureCustomized(MethodHandle mh) {
-                 mh.customize();
-             }
- 
              @Override
              public VarHandle memoryAccessVarHandle(Class<?> carrier, boolean skipAlignmentMaskCheck, long alignmentMask,
                                                     ByteOrder order) {
                  return VarHandles.makeMemoryAddressViewHandle(carrier, skipAlignmentMaskCheck, alignmentMask, order);
              }
  
              @Override
!             public MethodHandle nativeMethodHandle(NativeEntryPoint nep, MethodHandle fallback) {
!                 return NativeMethodHandle.make(nep, fallback);
              }
  
              @Override
              public VarHandle filterValue(VarHandle target, MethodHandle filterToTarget, MethodHandle filterFromTarget) {
                  return VarHandles.filterValue(target, filterToTarget, filterFromTarget);
--- 1456,19 ---
              @Override
              public Map<String, byte[]> generateHolderClasses(Stream<String> traces) {
                  return GenerateJLIClassesHelper.generateHolderClasses(traces);
              }
  
              @Override
              public VarHandle memoryAccessVarHandle(Class<?> carrier, boolean skipAlignmentMaskCheck, long alignmentMask,
                                                     ByteOrder order) {
                  return VarHandles.makeMemoryAddressViewHandle(carrier, skipAlignmentMaskCheck, alignmentMask, order);
              }
  
              @Override
!             public MethodHandle nativeMethodHandle(NativeEntryPoint nep) {
!                 return NativeMethodHandle.make(nep);
              }
  
              @Override
              public VarHandle filterValue(VarHandle target, MethodHandle filterToTarget, MethodHandle filterFromTarget) {
                  return VarHandles.filterValue(target, filterToTarget, filterFromTarget);

*** 1501,10 ***
--- 1496,15 ---
  
              @Override
              public VarHandle insertCoordinates(VarHandle target, int pos, Object... values) {
                  return VarHandles.insertCoordinates(target, pos, values);
              }
+ 
+             @Override
+             public Class<?>[] exceptionTypes(MethodHandle handle) {
+                 return VarHandles.exceptionTypes(handle);
+             }
          });
      }
  
      /** Result unboxing: ValueConversions.unbox() OR ValueConversions.identity() OR ValueConversions.ignore(). */
      private static MethodHandle unboxResultHandle(Class<?> returnType) {

*** 2107,19 ***
          return selectedCase.invokeWithArguments(args);
      }
  
      // Indexes into constant method handles:
      static final int
!             MH_cast                  = 0,
!             MH_selectAlternative     = 1,
!             MH_countedLoopPred       = 2,
!             MH_countedLoopStep       = 3,
!             MH_initIterator          = 4,
!             MH_iteratePred           = 5,
!             MH_iterateNext           = 6,
!             MH_Array_newInstance     = 7,
!             MH_LIMIT                 = 8;
  
      static MethodHandle getConstantHandle(int idx) {
          MethodHandle handle = HANDLES[idx];
          if (handle != null) {
              return handle;
--- 2107,20 ---
          return selectedCase.invokeWithArguments(args);
      }
  
      // Indexes into constant method handles:
      static final int
!             MH_cast                               = 0,
!             MH_selectAlternative                  = 1,
!             MH_countedLoopPred                    = 2,
!             MH_countedLoopStep                    = 3,
!             MH_initIterator                       = 4,
!             MH_iteratePred                        = 5,
!             MH_iterateNext                        = 6,
!             MH_Array_newInstance                  = 7,
!             MH_VarHandles_handleCheckedExceptions = 8,
+             MH_LIMIT                              = 9;
  
      static MethodHandle getConstantHandle(int idx) {
          MethodHandle handle = HANDLES[idx];
          if (handle != null) {
              return handle;

*** 2165,10 ***
--- 2166,13 ---
                      return IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "iterateNext",
                              MethodType.methodType(Object.class, Iterator.class));
                  case MH_Array_newInstance:
                      return IMPL_LOOKUP.findStatic(Array.class, "newInstance",
                              MethodType.methodType(Object.class, Class.class, int.class));
+                 case MH_VarHandles_handleCheckedExceptions:
+                     return IMPL_LOOKUP.findStatic(VarHandles.class, "handleCheckedExceptions",
+                             MethodType.methodType(void.class, Throwable.class));
              }
          } catch (ReflectiveOperationException ex) {
              throw newInternalError(ex);
          }
          throw newInternalError("Unknown function index: " + idx);
< prev index next >