/** * Gets the index of a local variable (the first index after method parameters). Indexes start with 0. */ private int getLocalVariableIndex(int i) { int index = classMethod.isStatic() ? 0 : 1; for (String type : classMethod.getParameters()) { if (type.equals(DOUBLE_CLASS_DESCRIPTOR) || type.equals(LONG_CLASS_DESCRIPTOR)) { index += 2; } else { index++; } } return index + i; } }
/** * Gets the index of a local variable (the first index after method parameters). Indexes start with 0. */ private int getLocalVariableIndex(int i) { int index = classMethod.isStatic() ? 0 : 1; for (String type : classMethod.getParameters()) { if (type.equals(DOUBLE_CLASS_DESCRIPTOR) || type.equals(LONG_CLASS_DESCRIPTOR)) { index += 2; } else { index++; } } return index + i; } }
/** * Gets the index of a local variable (the first index after method parameters). Indexes start with 0. */ private int getLocalVariableIndex(int i) { int index = classMethod.isStatic() ? 0 : 1; for (String type : classMethod.getParameters()) { if (type.equals(DOUBLE_CLASS_DESCRIPTOR) || type.equals(LONG_CLASS_DESCRIPTOR)) { index += 2; } else { index++; } } return index + i; } }
/** * Gets the index of a local variable (the first index after method parameters). Indexes start with 0. */ private int getLocalVariableIndex(int i) { int index = classMethod.isStatic() ? 0 : 1; for (String type : classMethod.getParameters()) { if (type.equals(DOUBLE_CLASS_DESCRIPTOR) || type.equals(LONG_CLASS_DESCRIPTOR)) { index += 2; } else { index++; } } return index + i; } }
/** * Gets the index of a local variable (the first index after method parameters). Indexes start with 0. */ private int getLocalVariableIndex(int i) { int index = classMethod.isStatic() ? 0 : 1; for (String type : classMethod.getParameters()) { if (type.equals(DOUBLE_CLASS_DESCRIPTOR) || type.equals(LONG_CLASS_DESCRIPTOR)) { index += 2; } else { index++; } } return index + i; } }
/** * Gets the index of a local variable (the first index after method parameters). Indexes start with 0. */ private int getLocalVariableIndex(int i) { int index = classMethod.isStatic() ? 0 : 1; for (String type : classMethod.getParameters()) { if (type.equals(DOUBLE_CLASS_DESCRIPTOR) || type.equals(LONG_CLASS_DESCRIPTOR)) { index += 2; } else { index++; } } return index + i; } }
public CodeAttribute(ClassMethod method, ConstPool constPool) { super(NAME, constPool); this.method = method; this.constPool = constPool; this.finalDataBytes = new ByteArrayOutputStream(); this.data = new DataOutputStream(finalDataBytes); if (!Modifier.isStatic(method.getAccessFlags())) { maxLocals++; } for (String param : method.getParameters()) { if (DescriptorUtils.isWide(param)) { maxLocals += 2; } else { maxLocals++; } } // creates a new initial stack frame currentFrame = new StackFrame(method); stackFrames.put(0, currentFrame); currentOffset = 0; stackMapTableAttribute = new StackMapTableAttribute(method, constPool); }
public CodeAttribute(ClassMethod method, ConstPool constPool) { super(NAME, constPool); this.method = method; this.constPool = constPool; this.finalDataBytes = new ByteArrayOutputStream(); this.data = new DataOutputStream(finalDataBytes); if (!Modifier.isStatic(method.getAccessFlags())) { maxLocals++; } for (String param : method.getParameters()) { if (DescriptorUtils.isWide(param)) { maxLocals += 2; } else { maxLocals++; } } // creates a new initial stack frame currentFrame = new StackFrame(method); stackFrames.put(0, currentFrame); currentOffset = 0; stackMapTableAttribute = new StackMapTableAttribute(method, constPool); }
public CodeAttribute(ClassMethod method, ConstPool constPool) { super(NAME, constPool); this.method = method; this.constPool = constPool; this.finalDataBytes = new ByteArrayOutputStream(); this.data = new DataOutputStream(finalDataBytes); if (!Modifier.isStatic(method.getAccessFlags())) { maxLocals++; } for (String param : method.getParameters()) { if (DescriptorUtils.isWide(param)) { maxLocals += 2; } else { maxLocals++; } } // creates a new initial stack frame currentFrame = new StackFrame(method); stackFrames.put(0, currentFrame); currentOffset = 0; stackMapTableAttribute = new StackMapTableAttribute(method, constPool); }
public CodeAttribute(ClassMethod method, ConstPool constPool) { super(NAME, constPool); this.method = method; this.constPool = constPool; this.finalDataBytes = new ByteArrayOutputStream(); this.data = new DataOutputStream(finalDataBytes); if (!Modifier.isStatic(method.getAccessFlags())) { maxLocals++; } for (String param : method.getParameters()) { if (DescriptorUtils.isWide(param)) { maxLocals += 2; } else { maxLocals++; } } // creates a new initial stack frame currentFrame = new StackFrame(method); stackFrames.put(0, currentFrame); currentOffset = 0; stackMapTableAttribute = new StackMapTableAttribute(method, constPool); }
public CodeAttribute(ClassMethod method, ConstPool constPool) { super(NAME, constPool); this.method = method; this.constPool = constPool; this.finalDataBytes = new ByteArrayOutputStream(); this.data = new DataOutputStream(finalDataBytes); if (!Modifier.isStatic(method.getAccessFlags())) { maxLocals++; } for (String param : method.getParameters()) { if (DescriptorUtils.isWide(param)) { maxLocals += 2; } else { maxLocals++; } } // creates a new initial stack frame currentFrame = new StackFrame(method); stackFrames.put(0, currentFrame); currentOffset = 0; stackMapTableAttribute = new StackMapTableAttribute(method, constPool); }
/** * loads all parameters onto the stack. * <p/> * If this method is non-static then the parameter at location 0 (i.e. this object) is not pushed. */ public void loadMethodParameters() { int index = method.isStatic() ? 0 : 1; for (String type : method.getParameters()) { if (type.length() > 1) { // object or array aload(index); } else if (type.equals("D")) { dload(index); index++; } else if (type.equals("J")) { lload(index); index++; } else if (type.equals("F")) { fload(index); } else { iload(index); } index++; } }
/** * loads all parameters onto the stack. * <p/> * If this method is non-static then the parameter at location 0 (i.e. this object) is not pushed. */ public void loadMethodParameters() { int index = method.isStatic() ? 0 : 1; for (String type : method.getParameters()) { if (type.length() > 1) { // object or array aload(index); } else if (type.equals("D")) { dload(index); index++; } else if (type.equals("J")) { lload(index); index++; } else if (type.equals("F")) { fload(index); } else { iload(index); } index++; } }
/** * loads all parameters onto the stack. * <p/> * If this method is non-static then the parameter at location 0 (i.e. this object) is not pushed. */ public void loadMethodParameters() { int index = method.isStatic() ? 0 : 1; for (String type : method.getParameters()) { if (type.length() > 1) { // object or array aload(index); } else if (type.equals("D")) { dload(index); index++; } else if (type.equals("J")) { lload(index); index++; } else if (type.equals("F")) { fload(index); } else { iload(index); } index++; } }
/** * loads all parameters onto the stack. * <p/> * If this method is non-static then the parameter at location 0 (i.e. this object) is not pushed. */ public void loadMethodParameters() { int index = method.isStatic() ? 0 : 1; for (String type : method.getParameters()) { if (type.length() > 1) { // object or array aload(index); } else if (type.equals("D")) { dload(index); index++; } else if (type.equals("J")) { lload(index); index++; } else if (type.equals("F")) { fload(index); } else { iload(index); } index++; } }
/** * construct the initial local variable state for a method */ public LocalVariableState(ClassMethod method) { this.constPool = method.getClassFile().getConstPool(); contents = new ArrayList<StackEntry>(); if (!method.isStatic()) { if (method.isConstructor()) { contents.add(new StackEntry(StackEntryType.UNINITIALIZED_THIS, method.getClassFile().getDescriptor())); } else { contents.add(StackEntry.of(method.getClassFile().getDescriptor(), method.getClassFile().getConstPool())); } } for (String param : method.getParameters()) { StackEntry entry = StackEntry.of(param, method.getClassFile().getConstPool()); contents.add(entry); if (entry.isWide()) { contents.add(new StackEntry(StackEntryType.TOP, param)); } } }
/** * construct the initial local variable state for a method */ public LocalVariableState(ClassMethod method) { this.constPool = method.getClassFile().getConstPool(); contents = new ArrayList<StackEntry>(); if (!method.isStatic()) { if (method.isConstructor()) { contents.add(new StackEntry(StackEntryType.UNINITIALIZED_THIS, method.getClassFile().getDescriptor())); } else { contents.add(StackEntry.of(method.getClassFile().getDescriptor(), method.getClassFile().getConstPool())); } } for (String param : method.getParameters()) { StackEntry entry = StackEntry.of(param, method.getClassFile().getConstPool()); contents.add(entry); if (entry.isWide()) { contents.add(new StackEntry(StackEntryType.TOP, param)); } } }
/** * construct the initial local variable state for a method */ public LocalVariableState(ClassMethod method) { this.constPool = method.getClassFile().getConstPool(); contents = new ArrayList<StackEntry>(); if (!method.isStatic()) { if (method.isConstructor()) { contents.add(new StackEntry(StackEntryType.UNINITIALIZED_THIS, method.getClassFile().getDescriptor())); } else { contents.add(StackEntry.of(method.getClassFile().getDescriptor(), method.getClassFile().getConstPool())); } } for (String param : method.getParameters()) { StackEntry entry = StackEntry.of(param, method.getClassFile().getConstPool()); contents.add(entry); if (entry.isWide()) { contents.add(new StackEntry(StackEntryType.TOP, param)); } } }
/** * construct the initial local variable state for a method */ public LocalVariableState(ClassMethod method) { this.constPool = method.getClassFile().getConstPool(); contents = new ArrayList<StackEntry>(); if (!method.isStatic()) { if (method.isConstructor()) { contents.add(new StackEntry(StackEntryType.UNINITIALIZED_THIS, method.getClassFile().getDescriptor())); } else { contents.add(StackEntry.of(method.getClassFile().getDescriptor(), method.getClassFile().getConstPool())); } } for (String param : method.getParameters()) { StackEntry entry = StackEntry.of(param, method.getClassFile().getConstPool()); contents.add(entry); if (entry.isWide()) { contents.add(new StackEntry(StackEntryType.TOP, param)); } } }
/** * construct the initial local variable state for a method */ public LocalVariableState(ClassMethod method) { this.constPool = method.getClassFile().getConstPool(); contents = new ArrayList<StackEntry>(); if (!method.isStatic()) { if (method.isConstructor()) { contents.add(new StackEntry(StackEntryType.UNINITIALIZED_THIS, method.getClassFile().getDescriptor())); } else { contents.add(StackEntry.of(method.getClassFile().getDescriptor(), method.getClassFile().getConstPool())); } } for (String param : method.getParameters()) { StackEntry entry = StackEntry.of(param, method.getClassFile().getConstPool()); contents.add(entry); if (entry.isWide()) { contents.add(new StackEntry(StackEntryType.TOP, param)); } } }