1 21 package proguard.classfile.attribute.preverification; 22 23 import proguard.classfile.*; 24 import proguard.classfile.attribute.*; 25 import proguard.classfile.attribute.preverification.visitor.StackMapFrameVisitor; 26 import proguard.classfile.attribute.visitor.AttributeVisitor; 27 28 33 public class StackMapTableAttribute extends Attribute 34 { 35 public int u2stackMapFramesCount; 36 public StackMapFrame[] stackMapFrames; 37 38 39 42 public StackMapTableAttribute() 43 { 44 } 45 46 47 50 public StackMapTableAttribute(StackMapFrame[] stackMapFrames) 51 { 52 this(stackMapFrames.length, stackMapFrames); 53 } 54 55 56 59 public StackMapTableAttribute(int stackMapFramesCount, 60 StackMapFrame[] stackMapFrames) 61 { 62 this.u2stackMapFramesCount = stackMapFramesCount; 63 this.stackMapFrames = stackMapFrames; 64 } 65 66 67 69 public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, AttributeVisitor attributeVisitor) 70 { 71 attributeVisitor.visitStackMapTableAttribute(clazz, method, codeAttribute, this); 72 } 73 74 75 78 public void stackMapFramesAccept(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapFrameVisitor stackMapFrameVisitor) 79 { 80 int offset = 0; 81 82 for (int index = 0; index < u2stackMapFramesCount; index++) 83 { 84 StackMapFrame stackMapFrame = stackMapFrames[index]; 85 86 offset += stackMapFrame.getOffsetDelta() + (index == 0 ? 0 : 1); 89 90 stackMapFrame.accept(clazz, method, codeAttribute, offset, stackMapFrameVisitor); 91 } 92 } 93 } 94 | Popular Tags |