src/org/nutz/repo/org/objectweb/asm/ClassReader.java
private int readFrame(int stackMap, boolean zip, boolean unzip,
            Context frame) {
        char[] c = frame.buffer;
        Label[] labels = frame.labels;
        int tag;
        int delta;
        if (zip) {
            tag = b[stackMap++] & 0xFF;
        } else {
            tag = MethodWriter.FULL_FRAME;
            frame.offset = -1;
        }
        frame.localDiff = 0;
        if (tag < MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME) {
            delta = tag;
            frame.mode = Opcodes.F_SAME;
            frame.stackCount = 0;
        } else if (tag < MethodWriter.RESERVED) {
            delta = tag - MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME;
            stackMap = readFrameType(frame.stack, 0, stackMap, c, labels);
            frame.mode = Opcodes.F_SAME1;
            frame.stackCount = 1;
        } else {
            delta = readUnsignedShort(stackMap);
            stackMap += 2;
            if (tag == MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
                stackMap = readFrameType(frame.stack, 0, stackMap, c, labels);
                frame.mode = Opcodes.F_SAME1;
                frame.stackCount = 1;
            } else if (tag >= MethodWriter.CHOP_FRAME
                    && tag < MethodWriter.SAME_FRAME_EXTENDED) {
                frame.mode = Opcodes.F_CHOP;
                frame.localDiff = MethodWriter.SAME_FRAME_EXTENDED - tag;
                frame.localCount -= frame.localDiff;
                frame.stackCount = 0;
            } else if (tag == MethodWriter.SAME_FRAME_EXTENDED) {
                frame.mode = Opcodes.F_SAME;
                frame.stackCount = 0;
            } else if (tag < MethodWriter.FULL_FRAME) {
                int local = unzip ? frame.localCount : 0;
                for (int i = tag - MethodWriter.SAME_FRAME_EXTENDED; i > 0; i--) {
                    stackMap = readFrameType(frame.local, local++, stackMap, c,
                            labels);
                }
                frame.mode = Opcodes.F_APPEND;
                frame.localDiff = tag - MethodWriter.SAME_FRAME_EXTENDED;
                frame.localCount += frame.localDiff;
                frame.stackCount = 0;
            } else { // if (tag == FULL_FRAME) {
                frame.mode = Opcodes.F_FULL;
                int n = readUnsignedShort(stackMap);
                stackMap += 2;
                frame.localDiff = n;
                frame.localCount = n;
                for (int local = 0; n > 0; n--) {
                    stackMap = readFrameType(frame.local, local++, stackMap, c,
                            labels);
                }
                n = readUnsignedShort(stackMap);
                stackMap += 2;
                frame.stackCount = n;
                for (int stack = 0; n > 0; n--) {
                    stackMap = readFrameType(frame.stack, stack++, stackMap, c,
                            labels);
                }
            }
        }
        frame.offset += delta + 1;
        readLabel(frame.offset, labels);
        return stackMap;
    }
private int readFrame(int stackMap, boolean zip, boolean unzip,
            Context frame) {
        char[] c = frame.buffer;
        Label[] labels = frame.labels;
        int tag;
        int delta;
        if (zip) {
            tag = b[stackMap++] & 0xFF;
        } else {
            tag = MethodWriter.FULL_FRAME;
            frame.offset = -1;
        }
        frame.localDiff = 0;
        if (tag < MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME) {
            delta = tag;
            frame.mode = Opcodes.F_SAME;
            frame.stackCount = 0;
        } else if (tag < MethodWriter.RESERVED) {
            delta = tag - MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME;
            stackMap = readFrameType(frame.stack, 0, stackMap, c, labels);
            frame.mode = Opcodes.F_SAME1;
            frame.stackCount = 1;
        } else {
            delta = readUnsignedShort(stackMap);
            stackMap += 2;
            if (tag == MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
                stackMap = readFrameType(frame.stack, 0, stackMap, c, labels);
                frame.mode = Opcodes.F_SAME1;
                frame.stackCount = 1;
            } else if (tag >= MethodWriter.CHOP_FRAME
                    && tag < MethodWriter.SAME_FRAME_EXTENDED) {
                frame.mode = Opcodes.F_CHOP;
                frame.localDiff = MethodWriter.SAME_FRAME_EXTENDED - tag;
                frame.localCount -= frame.localDiff;
                frame.stackCount = 0;
            } else if (tag == MethodWriter.SAME_FRAME_EXTENDED) {
                frame.mode = Opcodes.F_SAME;
                frame.stackCount = 0;
            } else if (tag < MethodWriter.FULL_FRAME) {
                int local = unzip ? frame.localCount : 0;
                for (int i = tag - MethodWriter.SAME_FRAME_EXTENDED; i > 0; i--) {
                    stackMap = readFrameType(frame.local, local++, stackMap, c,
                            labels);
                }
                frame.mode = Opcodes.F_APPEND;
                frame.localDiff = tag - MethodWriter.SAME_FRAME_EXTENDED;
                frame.localCount += frame.localDiff;
                frame.stackCount = 0;
            } else { // if (tag == FULL_FRAME) {
                frame.mode = Opcodes.F_FULL;
                int n = readUnsignedShort(stackMap);
                stackMap += 2;
                frame.localDiff = n;
                frame.localCount = n;
                for (int local = 0; n > 0; n--) {
                    stackMap = readFrameType(frame.local, local++, stackMap, c,
                            labels);
                }
                n = readUnsignedShort(stackMap);
                stackMap += 2;
                frame.stackCount = n;
                for (int stack = 0; n > 0; n--) {
                    stackMap = readFrameType(frame.stack, stack++, stackMap, c,
                            labels);
                }
            }
        }
        frame.offset += delta + 1;
        readLabel(frame.offset, labels);
        return stackMap;
    }
private int readFrame ( int stackMap , boolean zip , boolean unzip , Context frame ) { char [ ] c = frame . buffer ; Label [ ] labels = frame . labels ; int tag ; int delta ; if ( zip ) { tag = b [ stackMap ++ ] & 0xFF ; } else { tag = MethodWriter . FULL_FRAME ; frame . offset = - 1 ; } frame . localDiff = 0 ; if ( tag < MethodWriter . SAME_LOCALS_1_STACK_ITEM_FRAME ) { delta = tag ; frame . mode = Opcodes . F_SAME ; frame . stackCount = 0 ; } else if ( tag < MethodWriter . RESERVED ) { delta = tag - MethodWriter . SAME_LOCALS_1_STACK_ITEM_FRAME ; stackMap = readFrameType ( frame . stack , 0 , stackMap , c , labels ) ; frame . mode = Opcodes . F_SAME1 ; frame . stackCount = 1 ; } else { delta = readUnsignedShort ( stackMap ) ; stackMap += 2 ; if ( tag == MethodWriter . SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED ) { stackMap = readFrameType ( frame . stack , 0 , stackMap , c , labels ) ; frame . mode = Opcodes . F_SAME1 ; frame . stackCount = 1 ; } else if ( tag >= MethodWriter . CHOP_FRAME && tag < MethodWriter . SAME_FRAME_EXTENDED ) { frame . mode = Opcodes . F_CHOP ; frame . localDiff = MethodWriter . SAME_FRAME_EXTENDED - tag ; frame . localCount -= frame . localDiff ; frame . stackCount = 0 ; } else if ( tag == MethodWriter . SAME_FRAME_EXTENDED ) { frame . mode = Opcodes . F_SAME ; frame . stackCount = 0 ; } else if ( tag < MethodWriter . FULL_FRAME ) { int local = unzip ? frame . localCount : 0 ; for ( int i = tag - MethodWriter . SAME_FRAME_EXTENDED ; i > 0 ; i -- ) { stackMap = readFrameType ( frame . local , local ++ , stackMap , c , labels ) ; } frame . mode = Opcodes . F_APPEND ; frame . localDiff = tag - MethodWriter . SAME_FRAME_EXTENDED ; frame . localCount += frame . localDiff ; frame . stackCount = 0 ; } else { // if (tag == FULL_FRAME) { frame . mode = Opcodes . F_FULL ; int n = readUnsignedShort ( stackMap ) ; stackMap += 2 ; frame . localDiff = n ; frame . localCount = n ; for ( int local = 0 ; n > 0 ; n -- ) { stackMap = readFrameType ( frame . local , local ++ , stackMap , c , labels ) ; } n = readUnsignedShort ( stackMap ) ; stackMap += 2 ; frame . stackCount = n ; for ( int stack = 0 ; n > 0 ; n -- ) { stackMap = readFrameType ( frame . stack , stack ++ , stackMap , c , labels ) ; } } } frame . offset += delta + 1 ; readLabel ( frame . offset , labels ) ; return stackMap ; }
Reads a stack map frame and stores the result in the given
{@link Context} object.

@param stackMap
the start offset of a stack map frame in the class file.
@param zip
if the stack map frame at stackMap is compressed or not.
@param unzip
if the stack map frame must be uncompressed.
@param frame
where the parsed stack map frame must be stored.
@return the offset of the first byte following the parsed frame.
Reads a stack map frame and stores the result in the given { @link Context } object .