コード例 #1
0
ファイル: Shrinker.java プロジェクト: kostaskougios/javaflow
 private static int compareHandle(Handle h1, Handle h2) {
   int d = h1.getTag() - h2.getTag();
   if (d == 0) {
     d = h1.getOwner().compareTo(h2.getOwner());
     if (d == 0) {
       d = h1.getName().compareTo(h2.getName());
       if (d == 0) {
         d = h1.getDesc().compareTo(h2.getDesc());
       }
     }
   }
   return d;
 }
コード例 #2
0
  private String getLambdaAccessMethodDesc(Handle implMethod) {
    if (implMethod.getTag() == H_INVOKESTATIC) {
      // static method call -> keep as-is
      return implMethod.getDesc();

    } else if (implMethod.getTag() == H_NEWINVOKESPECIAL) {
      // constructor call -> change to a a factory method
      return Types.changeReturnType(
          Type.getObjectType(implMethod.getOwner()), implMethod.getDesc());

    } else {
      // instance method call -> change to a static method
      return Types.prependArgumentType(Type.getObjectType(className), implMethod.getDesc());
    }
  }
コード例 #3
0
 void addConstant(final Object cst) {
   if (cst instanceof Type) {
     addType((Type) cst);
   } else if (cst instanceof Handle) {
     Handle h = (Handle) cst;
     addInternalName(h.getOwner());
     addMethodDesc(h.getDesc());
   }
 }
コード例 #4
0
 void addConstant(final Object constant) {
   if (constant instanceof Type) {
     addType((Type) constant);
   } else if (constant instanceof Handle) {
     Handle handle = (Handle) constant;
     addInternalType(handle.getOwner());
     addMethodTypes(handle.getDesc());
   }
 }
コード例 #5
0
ファイル: Compiler.java プロジェクト: rwaldron/es6draft
 @Override
 public void visitLdcInsn(Object cst) {
   if (cst instanceof Handle) {
     Handle handle = (Handle) cst;
     cst =
         new Handle(
             handle.getTag(),
             handle.getOwner(),
             handle.getName(),
             getMethodDescriptor(handle.getDesc()));
   }
   super.visitLdcInsn(cst);
 }