Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. private void createMethod_2() {
  2. InstructionList il = new InstructionList();
  3. MethodGen method = new MethodGen(ACC_PUBLIC, Type.DOUBLE, Type.NO_ARGS, new String[] { }, "doit", "MyGeneratedClass0", il, _cp);
  4.  
  5. InstructionHandle ih_0 = il.append(new PUSH(_cp, 5.0));
  6. il.append(_factory.createStore(Type.DOUBLE, 1));
  7. il.append(_factory.createLoad(Type.OBJECT, 0));
  8. il.append(_factory.createInvoke("MyGeneratedClass0", "returnBoolType", Type.BOOLEAN, new Type[] { Type.DOUBLE }, Constants.INVOKEVIRTUAL));
  9. BranchInstruction ifeq_8 = _factory.createBranchInstruction(Constants.IFEQ, null);
  10. il.append(ifeq_8);
  11. il.append(new PUSH(_cp, 41.0));
  12. il.append(_factory.createStore(Type.DOUBLE, 1));
  13. BranchInstruction goto_15 = _factory.createBranchInstruction(Constants.GOTO, null);
  14. il.append(goto_15);
  15. InstructionHandle ih_18 = il.append(InstructionConstants.NOP);
  16. InstructionHandle ih_19 = il.append(InstructionConstants.NOP);
  17. il.append(_factory.createLoad(Type.DOUBLE, 1));
  18. InstructionHandle ih_21 = il.append(_factory.createReturn(Type.DOUBLE));
  19. ifeq_8.setTarget(ih_18);
  20. goto_15.setTarget(ih_19);
  21. method.setMaxStack();
  22. method.setMaxLocals();
  23. _cg.addMethod(method.getMethod());
  24. il.dispose();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement