private boolean isContinuableMethodProxy(int acc, String name, String desc, String signature, String[] exceptions) { int idx = name.lastIndexOf("$$super"); if (idx > 0) { name = name.substring(0, idx); } return ! "<init>".equals(name) && classInfo.isContinuableMethod(acc, name, desc, signature); } }
@Override public AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible) { if (MaybeContinuableClassVisitor.SKIP_ENCHANCING_ANNOTATION.equals(descriptor)) { skipEnchancing = true; classInfo.markClassProcessed(); throw StopException.INSTANCE; } return super.visitAnnotation(descriptor, visible); }
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { isInterface = (access & Opcodes.ACC_INTERFACE) != 0; className = name; classInfo = cciResolver.resolve(name, originalBytes); if (null == classInfo || classInfo.isClassProcessed() || StopException.__dirtyCheckSkipContinuationsOnClass(version, access, name, signature, superName, interfaces)) { skipEnchancing = true; // Must exit by throwing exception, otherwise NPE is possible in nested visitor throw StopException.INSTANCE; } cv.visit(version, access, name, signature, superName, interfaces); }
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { isInterface = (access & Opcodes.ACC_INTERFACE) != 0; className = name; classInfo = cciResolver.resolve(name, originalBytes); if (null == classInfo || classInfo.isClassProcessed() || StopException.__dirtyCheckSkipContinuationsOnClass(version, access, name, signature, superName, interfaces)) { skipEnchancing = true; // Must exit by throwing exception, otherwise NPE is possible in nested visitor throw StopException.INSTANCE; } cv.visit(version, access, name, signature, superName, interfaces); }
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); boolean skip = skipEnchancing || null == classInfo || mv == null || (access & (Opcodes.ACC_ABSTRACT | Opcodes.ACC_NATIVE)) > 0 || "<init>".equals(name) || !classInfo.isContinuableMethod(access, name, desc, signature); if (skip) { return mv; } else { return new ContinuableMethodNode( access, name, desc, signature, exceptions, className, inheritanceLookup, cciResolver, mv ); } } }
@Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { if (MaybeContinuableClassVisitor.MARKER_FIELD_NAME.equals(name) && (access & Opcodes.ACC_STATIC) != 0) { skipEnchancing = true; classInfo.markClassProcessed(); throw StopException.INSTANCE; } return super.visitField(access, name, desc, signature, value); }
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { isInterface = (access & Opcodes.ACC_INTERFACE) != 0; className = name; classInfo = cciResolver.resolve(name, originalBytes); if (null == classInfo || classInfo.isClassProcessed() || StopException.__dirtyCheckSkipContinuationsOnClass(version, access, name, signature, superName, interfaces)) { skipEnchancing = true; // Must exit by throwing exception, otherwise NPE is possible in nested visitor throw StopException.INSTANCE; } cv.visit(version, access, name, signature, superName, interfaces); }
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); boolean skip = skipEnchancing || null == classInfo || mv == null || (access & (Opcodes.ACC_ABSTRACT | Opcodes.ACC_NATIVE)) > 0 || "<init>".equals(name) || !classInfo.isContinuableMethod(access, name, desc, signature); if (skip) { return mv; } else { return new ContinuableMethodNode( access, name, desc, signature, exceptions, className, inheritanceLookup, cciResolver, mv ); } } }
@Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { if (MaybeContinuableClassVisitor.MARKER_FIELD_NAME.equals(name) && (access & Opcodes.ACC_STATIC) != 0) { skipEnchancing = true; classInfo.markClassProcessed(); throw StopException.INSTANCE; } return super.visitField(access, name, desc, signature, value); }
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { isInterface = (access & Opcodes.ACC_INTERFACE) != 0; className = name; classInfo = cciResolver.resolve(name, originalBytes); if (null == classInfo || classInfo.isClassProcessed() || StopException.__dirtyCheckSkipContinuationsOnClass(version, access, name, signature, superName, interfaces)) { skipEnchancing = true; // Must exit by throwing exception, otherwise NPE is possible in nested visitor throw StopException.INSTANCE; } cv.visit(version, access, name, signature, superName, interfaces); }
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); boolean skip = skipEnchancing || null == classInfo || mv == null || (access & (Opcodes.ACC_ABSTRACT | Opcodes.ACC_NATIVE)) > 0 || "<init>".equals(name) || !classInfo.isContinuableMethod(access, name, desc, signature); if (skip) { return mv; } else { return new ContinuableMethodNode( access, name, desc, signature, exceptions, className, inheritanceLookup, cciResolver, mv ); } } }
@Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { if (MaybeContinuableClassVisitor.MARKER_FIELD_NAME.equals(name) && (access & Opcodes.ACC_STATIC) != 0) { skipEnchancing = true; classInfo.markClassProcessed(); throw StopException.INSTANCE; } return super.visitField(access, name, desc, signature, value); }
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { className = name; classInfo = cciResolver.resolve(name, originalBytes); if (null == classInfo || classInfo.isClassProcessed() || cciResolver.veto().matches(name, signature, superName, interfaces)) { skipEnchancing = true; // Must exit by throwing exception, otherwise NPE is possible in nested visitor throw StopException.INSTANCE; } cv.visit(version, access, name, signature, superName, interfaces); }
@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); boolean skip = skipEnchancing || null == classInfo || mv == null || (access & (Opcodes.ACC_ABSTRACT | Opcodes.ACC_NATIVE)) > 0 || "<init>".equals(name) || !classInfo.isContinuableMethod(access, name, desc, signature); if (skip) { return mv; } else { return new ContinuableMethodNode( access, name, desc, signature, exceptions, className, inheritanceLookup, cciResolver, mv ); } } }
@Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { if (MaybeContinuableClassVisitor.MARKER_FIELD_NAME.equals(name) && (access & Opcodes.ACC_STATIC) != 0) { skipEnchancing = true; classInfo.markClassProcessed(); throw StopException.INSTANCE; } return super.visitField(access, name, desc, signature, value); }
boolean needsFrameGuard(int opcode, String owner, String name, String desc) { if (owner.startsWith("java/") || owner.startsWith("javax/")) { //System.out.println("SKIP:: " + owner + "." + name + desc); return false; } // Always create save-point before Continuation methods (like suspend) if (CONTINUATION_CLASS_INTERNAL_NAME.equals(owner)) { return CONTINUATION_CLASS_CONTINUABLE_METHODS.contains(name); } // No need to create save-point before constructors -- it's forbidden to suspend in constructors anyway if (opcode == Opcodes.INVOKESPECIAL && "<init>".equals(name)) { return false; } if (opcode == Opcodes.INVOKEINTERFACE || opcode == Opcodes.INVOKESPECIAL || opcode == Opcodes.INVOKESTATIC || opcode == Opcodes.INVOKEVIRTUAL) { ContinuableClassInfo classInfo; try { classInfo = cciResolver.resolve(owner); } catch (IOException ex) { throw new RuntimeException(ex); } return null != classInfo && classInfo.isContinuableMethod(opcode, name, desc, desc); } return false; }
throw new RuntimeException(ex); return null != classInfo && classInfo.isContinuableMethod(opcode, name, desc, desc);
throw new RuntimeException(ex); return null != classInfo && classInfo.isContinuableMethod(opcode, name, desc, desc);
throw new RuntimeException(ex); return null != classInfo && classInfo.isContinuableMethod(opcode, name, desc, desc);
throw new RuntimeException(ex); return null != classInfo && classInfo.isContinuableMethod(opcode, name, desc, desc);