Home | History | Annotate | Download | only in compiler

Lines Matching full:bytecode

2  * Javassist, a Java-bytecode translator toolkit.
21 import javassist.bytecode.*;
35 protected Bytecode bytecode;
61 protected abstract boolean doit(Bytecode b, int opcode);
82 public CodeGen(Bytecode b) {
83 bytecode = b;
105 public int getMaxLocals() { return bytecode.getMaxLocals(); }
108 bytecode.setMaxLocals(n);
112 bytecode.incMaxLocals(size);
294 bytecode.addOpcode(Opcode.RETURN);
339 bytecode.addOpcode(POP2);
341 bytecode.addOpcode(POP);
384 int pc = bytecode.currentPc();
386 bytecode.addIndex(0); // correct later
396 bytecode.addOpcode(Opcode.GOTO);
397 pc2 = bytecode.currentPc();
398 bytecode.addIndex(0);
401 bytecode.write16bit(pc, bytecode.currentPc() - pc + 1);
406 bytecode.write16bit(pc2, bytecode.currentPc() - pc2 + 1);
423 bytecode.addOpcode(Opcode.GOTO);
424 pc = bytecode.currentPc();
425 bytecode.addIndex(0);
428 int pc2 = bytecode.currentPc();
432 int pc3 = bytecode.currentPc();
434 bytecode.write16bit(pc, pc3 - pc + 1);
437 bytecode.addIndex(pc2 - bytecode.currentPc() + 1);
439 patchGoto(breakList, bytecode.currentPc());
450 bytecode.write16bit(pc, targetPc - pc + 1);
470 int pc = bytecode.currentPc();
474 pc2 = bytecode.currentPc();
475 bytecode.addIndex(0);
481 int pc3 = bytecode.currentPc();
485 bytecode.addOpcode(Opcode.GOTO);
486 bytecode.addIndex(pc - bytecode.currentPc() + 1);
488 int pc4 = bytecode.currentPc();
490 bytecode.write16bit(pc2, pc4 - pc2 + 1);
504 int opcodePc = bytecode.currentPc();
505 bytecode.addOpcode(LOOKUPSWITCH);
508 bytecode.add(0);
517 int opcodePc2 = bytecode.currentPc();
518 bytecode.addGap(4);
519 bytecode.add32bit(npairs);
520 bytecode.addGap(npairs * 8);
529 defaultPc = bytecode.currentPc();
535 ((long)(bytecode.currentPc() - opcodePc) & 0xffffffff);
545 bytecode.write32bit(pc, (int)(pairs[i] >>> 32));
546 bytecode.write32bit(pc + 4, (int)pairs[i]);
553 int endPc = bytecode.currentPc();
557 bytecode
579 bytecode.addOpcode(Opcode.GOTO);
580 Integer pc = new Integer(bytecode.currentPc());
581 bytecode.addIndex(0);
616 if (har.doit(bytecode, op)) {
621 bytecode.addOpcode(op);
631 bytecode.addOpcode(ATHROW);
649 Bytecode bc = bytecode;
657 protected boolean doit(Bytecode b, int opcode) {
796 bytecode.addOpcode(DUP2);
798 bytecode.addOpcode(DUP);
801 bytecode.addAstore(varNo);
803 bytecode.addDstore(varNo);
805 bytecode.addFstore(varNo);
807 bytecode.addLstore(varNo);
809 bytecode.addAstore(varNo);
811 bytecode.addIstore(varNo);
827 bytecode.addOpcode(DUP2);
828 bytecode.addOpcode(getArrayReadOp(exprType, arrayDim));
839 bytecode.addOpcode(DUP2_X2);
841 bytecode.addOpcode(DUP_X2);
843 bytecode.addOpcode(getArrayWriteOp(aType, aDim));
890 bytecode.addInvokevirtual(javaLangString, "concat",
918 int pc = bytecode.currentPc();
919 bytecode.addIndex(0); // correct later
922 bytecode.addOpcode(Opcode.GOTO);
923 int pc2 = bytecode.currentPc();
924 bytecode.addIndex(0);
925 bytecode.write16bit(pc, bytecode.currentPc() - pc + 1);
930 bytecode.write16bit(pc2, bytecode.currentPc() - pc2 + 1);
985 bytecode.addIndex(7);
986 bytecode.addIconst(0); // false
987 bytecode.addOpcode(Opcode.GOTO);
988 bytecode.addIndex(4);
989 bytecode.addIconst(1); // true
1020 bytecode.addOpcode(op);
1041 bytecode.addOpcode(DUP_X2);
1042 bytecode.addOpcode(POP);
1045 bytecode.addOpcode(SWAP);
1049 bytecode.addOpcode(SWAP);
1054 bytecode.addInvokevirtual(javaLangString, "concat",
1065 bytecode.addInvokestatic(javaLangString, method,
1068 bytecode.addInvokestatic(javaLangString, method,
1071 bytecode.addInvokestatic(javaLangString, method,
1074 bytecode.addInvokestatic(javaLangString, method,
1077 bytecode.addInvokestatic(javaLangString, method,
1080 bytecode.addInvokestatic(javaLangString, method,
1085 bytecode.addInvokestatic(javaLangString, method,
1111 int pc = bytecode.currentPc();
1112 bytecode.addIndex(0); // correct later
1115 bytecode.write16bit(pc, bytecode.currentPc() - pc + 3);
1117 bytecode.addIndex(6); // skip GOTO instruction
1118 bytecode.addOpcode(Opcode.GOTO);
1122 bytecode.addOpcode(Opcode.GOTO);
1130 bytecode.addOpcode(branchIf ? IFNE : IFEQ);
1211 bytecode.addOpcode(branchIf ? IF_ACMPEQ : IF_ACMPNE);
1213 bytecode.addOpcode(branchIf ? IF_ACMPNE : IF_ACMPEQ);
1221 bytecode.addOpcode(op[i + (branchIf ? 1 : 2)]);
1230 bytecode.addOpcode(DCMPG);
1232 bytecode.addOpcode(DCMPL);
1235 bytecode.addOpcode(FCMPG);
1237 bytecode.addOpcode(FCMPL);
1239 bytecode.addOpcode(LCMP); // 1: >, 0: =, -1: <
1246 bytecode.addOpcode(op[i + (branchIf ? 1 : 2)]);
1334 bytecode.addOpcode(DUP2_X2);
1336 bytecode.addOpcode(DUP2_X1);
1338 bytecode.addOpcode(POP2);
1339 bytecode.addOpcode(op);
1340 bytecode.addOpcode(DUP2_X2);
1341 bytecode.addOpcode(POP2);
1345 bytecode.addOpcode(DUP_X2);
1346 bytecode.addOpcode(POP);
1349 bytecode.addOpcode(SWAP);
1351 bytecode.addOpcode(op);
1352 bytecode.addOpcode(SWAP);
1358 bytecode.addOpcode(op);
1371 bytecode.addCheckcast(toClass);
1377 bytecode.addInstanceof(toClass);
1438 bytecode.addOpcode(op);
1442 bytecode.addOpcode(op2);
1471 bytecode.addIndex(7);
1472 bytecode.addIconst(1);
1473 bytecode.addOpcode(Opcode.GOTO);
1474 bytecode.addIndex(4);
1475 bytecode.addIconst(0);
1487 bytecode.addOpcode(DNEG);
1489 bytecode.addOpcode(FNEG);
1491 bytecode.addOpcode(LNEG);
1493 bytecode.addOpcode(INEG);
1501 bytecode.addIconst(-1);
1502 bytecode.addOpcode(IXOR);
1506 bytecode.addLconst(-1);
1507 bytecode.addOpcode(LXOR);
1572 int start = bytecode.currentPc();
1573 bytecode.addLdc(cname);
1574 bytecode.addInvokestatic("java.lang.Class", "forName",
1576 int end = bytecode.currentPc();
1577 bytecode.addOpcode(Opcode.GOTO);
1578 int pc = bytecode.currentPc();
1579 bytecode.addIndex(0); // correct later
1581 bytecode.addExceptionHandler(start, end, bytecode.currentPc(),
1588 bytecode.growStack(1);
1589 bytecode.addAstore(var);
1591 bytecode.addNew("java.lang.NoClassDefFoundError");
1592 bytecode.addOpcode(DUP);
1593 bytecode.addAload(var);
1594 bytecode.addInvokevirtual("java.lang.ClassNotFoundException",
1596 bytecode.addInvokespecial("java.lang.NoClassDefFoundError", "<init>",
1600 bytecode.growStack(1);
1601 bytecode.addInvokestatic("javassist.runtime.DotClass", "fail",
1604 bytecode.addOpcode(ATHROW);
1605 bytecode.write16bit(pc, bytecode.currentPc() - pc + 1);
1612 bytecode.addOpcode(getArrayReadOp(exprType, arrayDim));
1701 bytecode.addDload(var);
1703 bytecode.addOpcode(DUP2);
1705 bytecode.addDconst(1.0);
1706 bytecode.addOpcode(token == PLUSPLUS ? DADD : DSUB);
1708 bytecode.addOpcode(DUP2);
1710 bytecode.addDstore(var);
1713 bytecode.addLload(var);
1715 bytecode.addOpcode(DUP2);
1717 bytecode.addLconst((long)1);
1718 bytecode.addOpcode(token == PLUSPLUS ? LADD : LSUB);
1720 bytecode.addOpcode(DUP2);
1722 bytecode.addLstore(var);
1725 bytecode.addFload(var);
1727 bytecode.addOpcode(DUP);
1729 bytecode.addFconst(1.0f);
1730 bytecode.addOpcode(token == PLUSPLUS ? FADD : FSUB);
1732 bytecode.addOpcode(DUP);
1734 bytecode.addFstore(var);
1738 bytecode.addIload(var);
1742 bytecode.addOpcode(WIDE);
1743 bytecode.addOpcode(IINC);
1744 bytecode.addIndex(var);
1745 bytecode.addIndex(delta);
1748 bytecode.addOpcode(IINC);
1749 bytecode.add(var);
1750 bytecode.add(delta);
1754 bytecode.addIload(var);
1781 bytecode.addOpcode(DUP2);
1782 bytecode.addOpcode(getArrayReadOp(t, arrayDim));
1785 bytecode.addOpcode(getArrayWriteOp(t, dim));
1795 bytecode.addOpcode(dup_code);
1798 bytecode.addIconst(1);
1799 bytecode.addOpcode(token == PLUSPLUS ? IADD : ISUB);
1803 bytecode.addLconst((long)1);
1804 bytecode.addOpcode(token == PLUSPLUS ? LADD : LSUB);
1807 bytecode.addFconst(1.0f);
1808 bytecode.addOpcode(token == PLUSPLUS ? FADD : FSUB);
1811 bytecode.addDconst(1.0);
1812 bytecode.addOpcode(token == PLUSPLUS ? DADD : DSUB);
1818 bytecode.addOpcode(dup_code);
1834 bytecode.addAload(var);
1838 bytecode.addAload(var);
1841 bytecode.addLload(var);
1844 bytecode.addFload(var);
1847 bytecode.addDload(var);
1850 bytecode.addIload(var);
1860 bytecode.addIconst(1);
1864 bytecode.addIconst(0);
1868 bytecode.addOpcode(ACONST_NULL);
1877 bytecode.addAload(0);
1893 bytecode.addLdc(s.get());
1902 bytecode.addIconst((int)value);
1906 bytecode.addLconst(value);
1914 bytecode.addDconst(d.get());
1918 bytecode.addFconst((float)d.get());