Java Code Examples for org.apache.bcel.Const#SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED
The following examples show how to use
org.apache.bcel.Const#SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StackMapAnalyzer.java From spotbugs with GNU Lesser General Public License v2.1 | 6 votes |
static StackFrameType get(int frame_type) { if (frame_type >= Const.SAME_FRAME && frame_type <= Const.SAME_FRAME_MAX) { return SAME_FRAME; } else if (frame_type >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME && frame_type <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) { return SAME_LOCALS_1_STACK_ITEM_FRAME; } else if (frame_type == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) { return SAME_LOCALS_1_STACK_ITEM_FRAME; } else if (frame_type >= Const.CHOP_FRAME && frame_type <= Const.CHOP_FRAME_MAX) { return CHOP_FRAME; } else if (frame_type == Const.SAME_FRAME_EXTENDED) { return SAME_FRAME; } else if (frame_type >= Const.APPEND_FRAME && frame_type <= Const.APPEND_FRAME_MAX) { return APPEND_FRAME; } else if (frame_type == Const.FULL_FRAME) { return FULL_FRAME; } else { /* Can't happen */ throw new ClassFormatException("Invalid frame type : " + frame_type); } }
Example 2
Source File: StackMapEntry.java From commons-bcel with Apache License 2.0 | 6 votes |
public void setFrameType( final int f ) { if (f >= Const.SAME_FRAME && f <= Const.SAME_FRAME_MAX) { byteCodeOffset = f - Const.SAME_FRAME; } else if (f >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME && f <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) { byteCodeOffset = f - Const.SAME_LOCALS_1_STACK_ITEM_FRAME; } else if (f == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock } else if (f >= Const.CHOP_FRAME && f <= Const.CHOP_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock } else if (f == Const.SAME_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock } else if (f >= Const.APPEND_FRAME && f <= Const.APPEND_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock } else if (f == Const.FULL_FRAME) { // CHECKSTYLE IGNORE EmptyBlock } else { throw new IllegalArgumentException("Invalid StackMap frameType"); } frameType = f; }
Example 3
Source File: StackMapEntry.java From commons-bcel with Apache License 2.0 | 5 votes |
public void setByteCodeOffset( final int new_offset ) { if (new_offset < 0 || new_offset > 32767) { throw new IllegalArgumentException("Invalid StackMap offset: " + new_offset); } if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) { if (new_offset > Const.SAME_FRAME_MAX) { frameType = Const.SAME_FRAME_EXTENDED; } else { frameType = new_offset; } } else if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME && frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) { if (new_offset > Const.SAME_FRAME_MAX) { frameType = Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED; } else { frameType = Const.SAME_LOCALS_1_STACK_ITEM_FRAME + new_offset; } } else if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock } else if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock } else if (frameType == Const.SAME_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock } else if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock } else if (frameType == Const.FULL_FRAME) { // CHECKSTYLE IGNORE EmptyBlock } else { throw new IllegalStateException("Invalid StackMap frameType: " + frameType); } byteCodeOffset = new_offset; }
Example 4
Source File: StackMapEntry.java From commons-bcel with Apache License 2.0 | 4 votes |
/** * @return String representation. */ @Override public String toString() { final StringBuilder buf = new StringBuilder(64); buf.append("("); if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) { buf.append("SAME"); } else if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME && frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) { buf.append("SAME_LOCALS_1_STACK"); } else if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) { buf.append("SAME_LOCALS_1_STACK_EXTENDED"); } else if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX) { buf.append("CHOP ").append(String.valueOf(251-frameType)); } else if (frameType == Const.SAME_FRAME_EXTENDED) { buf.append("SAME_EXTENDED"); } else if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) { buf.append("APPEND ").append(String.valueOf(frameType-251)); } else if (frameType == Const.FULL_FRAME) { buf.append("FULL"); } else { buf.append("UNKNOWN (").append(frameType).append(")"); } buf.append(", offset delta=").append(byteCodeOffset); if (typesOfLocals.length > 0) { buf.append(", locals={"); for (int i = 0; i < typesOfLocals.length; i++) { buf.append(typesOfLocals[i]); if (i < typesOfLocals.length - 1) { buf.append(", "); } } buf.append("}"); } if (typesOfStackItems.length > 0) { buf.append(", stack items={"); for (int i = 0; i < typesOfStackItems.length; i++) { buf.append(typesOfStackItems[i]); if (i < typesOfStackItems.length - 1) { buf.append(", "); } } buf.append("}"); } buf.append(")"); return buf.toString(); }