Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void createMethod_2() {
- InstructionList il = new InstructionList();
- MethodGen method = new MethodGen(ACC_PUBLIC, Type.DOUBLE, Type.NO_ARGS, new String[] { }, "doit", "MyGeneratedClass0", il, _cp);
- InstructionHandle ih_0 = il.append(new PUSH(_cp, 5.0));
- il.append(_factory.createStore(Type.DOUBLE, 1));
- il.append(_factory.createLoad(Type.OBJECT, 0));
- il.append(_factory.createInvoke("MyGeneratedClass0", "returnBoolType", Type.BOOLEAN, new Type[] { Type.DOUBLE }, Constants.INVOKEVIRTUAL));
- BranchInstruction ifeq_8 = _factory.createBranchInstruction(Constants.IFEQ, null);
- il.append(ifeq_8);
- il.append(new PUSH(_cp, 41.0));
- il.append(_factory.createStore(Type.DOUBLE, 1));
- BranchInstruction goto_15 = _factory.createBranchInstruction(Constants.GOTO, null);
- il.append(goto_15);
- InstructionHandle ih_18 = il.append(InstructionConstants.NOP);
- InstructionHandle ih_19 = il.append(InstructionConstants.NOP);
- il.append(_factory.createLoad(Type.DOUBLE, 1));
- InstructionHandle ih_21 = il.append(_factory.createReturn(Type.DOUBLE));
- ifeq_8.setTarget(ih_18);
- goto_15.setTarget(ih_19);
- method.setMaxStack();
- method.setMaxLocals();
- _cg.addMethod(method.getMethod());
- il.dispose();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement