/** * Creates a new CompactCodeAttributeComposer. * @param allowExternalBranchTargets specifies whether branch targets * can lie outside the code fragment * of the branch instructions. * @param allowExternalExceptionHandlers specifies whether exception * handlers can lie outside the code * fragment in which exceptions are * defined. * @param shrinkInstructions specifies whether instructions * should automatically be shrunk * before being written. */ public CompactCodeAttributeComposer(ProgramClass targetClass, boolean allowExternalBranchTargets, boolean allowExternalExceptionHandlers, boolean shrinkInstructions) { constantPoolEditor = new ConstantPoolEditor(targetClass); codeAttributeComposer = new CodeAttributeComposer(allowExternalBranchTargets, allowExternalExceptionHandlers, shrinkInstructions); }
/** * Creates a new CompactCodeAttributeComposer. * @param allowExternalBranchTargets specifies whether branch targets * can lie outside the code fragment * of the branch instructions. * @param allowExternalExceptionHandlers specifies whether exception * handlers can lie outside the code * fragment in which exceptions are * defined. * @param shrinkInstructions specifies whether instructions * should automatically be shrunk * before being written. */ public CompactCodeAttributeComposer(ProgramClass targetClass, boolean allowExternalBranchTargets, boolean allowExternalExceptionHandlers, boolean shrinkInstructions) { constantPoolEditor = new ConstantPoolEditor(targetClass); codeAttributeComposer = new CodeAttributeComposer(allowExternalBranchTargets, allowExternalExceptionHandlers, shrinkInstructions); }
/** * Creates a new CompactCodeAttributeComposer. * @param allowExternalBranchTargets specifies whether branch targets * can lie outside the code fragment * of the branch instructions. * @param allowExternalExceptionHandlers specifies whether exception * handlers can lie outside the code * fragment in which exceptions are * defined. * @param shrinkInstructions specifies whether instructions * should automatically be shrunk * before being written. */ public CompactCodeAttributeComposer(ProgramClass targetClass, boolean allowExternalBranchTargets, boolean allowExternalExceptionHandlers, boolean shrinkInstructions) { constantPoolEditor = new ConstantPoolEditor(targetClass); codeAttributeComposer = new CodeAttributeComposer(allowExternalBranchTargets, allowExternalExceptionHandlers, shrinkInstructions); }
EMPTY_ATTRIBUTES); CodeAttributeComposer codeAttributeComposer = new CodeAttributeComposer();
public static void main(String[] args) { CodeAttributeComposer composer = new CodeAttributeComposer(); composer.beginCodeFragment(4); composer.appendInstruction(0, new SimpleInstruction(InstructionConstants.OP_ICONST_0)); composer.appendInstruction(1, new VariableInstruction(InstructionConstants.OP_ISTORE, 0)); composer.appendInstruction(2, new BranchInstruction(InstructionConstants.OP_GOTO, 1)); composer.beginCodeFragment(4); composer.appendInstruction(0, new VariableInstruction(InstructionConstants.OP_IINC, 0, 1)); composer.appendInstruction(1, new VariableInstruction(InstructionConstants.OP_ILOAD, 0)); composer.appendInstruction(2, new SimpleInstruction(InstructionConstants.OP_ICONST_5)); composer.appendInstruction(3, new BranchInstruction(InstructionConstants.OP_IFICMPLT, -3)); composer.endCodeFragment(); composer.appendInstruction(3, new SimpleInstruction(InstructionConstants.OP_RETURN)); composer.endCodeFragment(); } }
public static void main(String[] args) { CodeAttributeComposer composer = new CodeAttributeComposer(); composer.beginCodeFragment(4); composer.appendInstruction(0, new SimpleInstruction(InstructionConstants.OP_ICONST_0)); composer.appendInstruction(1, new VariableInstruction(InstructionConstants.OP_ISTORE, 0)); composer.appendInstruction(2, new BranchInstruction(InstructionConstants.OP_GOTO, 1)); composer.beginCodeFragment(4); composer.appendInstruction(0, new VariableInstruction(InstructionConstants.OP_IINC, 0, 1)); composer.appendInstruction(1, new VariableInstruction(InstructionConstants.OP_ILOAD, 0)); composer.appendInstruction(2, new SimpleInstruction(InstructionConstants.OP_ICONST_5)); composer.appendInstruction(3, new BranchInstruction(InstructionConstants.OP_IFICMPLT, -3)); composer.endCodeFragment(); composer.appendInstruction(3, new SimpleInstruction(InstructionConstants.OP_RETURN)); composer.endCodeFragment(); } }
public static void main(String[] args) { CodeAttributeComposer composer = new CodeAttributeComposer(); composer.beginCodeFragment(4); composer.appendInstruction(0, new SimpleInstruction(InstructionConstants.OP_ICONST_0)); composer.appendInstruction(1, new VariableInstruction(InstructionConstants.OP_ISTORE, 0)); composer.appendInstruction(2, new BranchInstruction(InstructionConstants.OP_GOTO, 1)); composer.beginCodeFragment(4); composer.appendInstruction(0, new VariableInstruction(InstructionConstants.OP_IINC, 0, 1)); composer.appendInstruction(1, new VariableInstruction(InstructionConstants.OP_ILOAD, 0)); composer.appendInstruction(2, new SimpleInstruction(InstructionConstants.OP_ICONST_5)); composer.appendInstruction(3, new BranchInstruction(InstructionConstants.OP_IFICMPLT, -3)); composer.endCodeFragment(); composer.appendInstruction(3, new SimpleInstruction(InstructionConstants.OP_RETURN)); composer.endCodeFragment(); } }
public static void main(String[] args) { CodeAttributeComposer composer = new CodeAttributeComposer(); composer.beginCodeFragment(4); composer.appendInstruction(0, new SimpleInstruction(InstructionConstants.OP_ICONST_0)); composer.appendInstruction(1, new VariableInstruction(InstructionConstants.OP_ISTORE, 0)); composer.appendInstruction(2, new BranchInstruction(InstructionConstants.OP_GOTO, 1)); composer.beginCodeFragment(4); composer.appendInstruction(0, new VariableInstruction(InstructionConstants.OP_IINC, 0, 1)); composer.appendInstruction(1, new VariableInstruction(InstructionConstants.OP_ILOAD, 0)); composer.appendInstruction(2, new SimpleInstruction(InstructionConstants.OP_ICONST_5)); composer.appendInstruction(3, new BranchInstruction(InstructionConstants.OP_IFICMPLT, -3)); composer.endCodeFragment(); composer.appendInstruction(3, new SimpleInstruction(InstructionConstants.OP_RETURN)); composer.endCodeFragment(); } }
new CodeAttribute(constantPoolEditor.addUtf8Constant(ClassConstants.ATTR_Code)); CodeAttributeComposer composer = new CodeAttributeComposer(); composer.reset(); composer.beginCodeFragment(0);
new CodeAttribute(constantPoolEditor.addUtf8Constant(ClassConstants.ATTR_Code)); CodeAttributeComposer composer = new CodeAttributeComposer(); composer.reset(); composer.beginCodeFragment(0);
new CodeAttribute(constantPoolEditor.addUtf8Constant(ClassConstants.ATTR_Code)); CodeAttributeComposer composer = new CodeAttributeComposer(); composer.reset(); composer.beginCodeFragment(0);
EMPTY_ATTRIBUTES); CodeAttributeComposer codeAttributeComposer = new CodeAttributeComposer();
EMPTY_ATTRIBUTES); CodeAttributeComposer codeAttributeComposer = new CodeAttributeComposer();
EMPTY_ATTRIBUTES); CodeAttributeComposer codeAttributeComposer = new CodeAttributeComposer();