예제 #1
0
파일: Frame.java 프로젝트: linker2008/Hinge
 /**
  * Pops a type from the output frame stack.
  *
  * @param desc the descriptor of the type to be popped. Can also be a method descriptor (in this
  *     case this method pops the types corresponding to the method arguments).
  */
 private void pop(final String desc) {
   char c = desc.charAt(0);
   if (c == '(') {
     pop((Type.getArgumentsAndReturnSizes(desc) >> 2) - 1);
   } else if (c == 'J' || c == 'D') {
     pop(2);
   } else {
     pop(1);
   }
 }
예제 #2
0
 private static void genDefaultSuperCallCheckIfNeeded(
     @NotNull InstructionAdapter iv, @NotNull Method defaultMethod) {
   String defaultMethodName = defaultMethod.getName();
   if ("<init>".equals(defaultMethodName)) {
     return;
   }
   Label end = new Label();
   int handleIndex =
       (Type.getArgumentsAndReturnSizes(defaultMethod.getDescriptor()) >> 2)
           - 2; /*-1 for this, and -1 for handle*/
   iv.load(handleIndex, OBJECT_TYPE);
   iv.ifnull(end);
   AsmUtil.genThrow(
       iv,
       "java/lang/UnsupportedOperationException",
       "Super calls with default arguments not supported in this target, function: "
           + StringsKt.substringBeforeLast(
               defaultMethodName, JvmAbi.DEFAULT_PARAMS_IMPL_SUFFIX, defaultMethodName));
   iv.visitLabel(end);
 }