private void genIfCmpStmt(final IfCmpStmt stmt) {
		int opcode;

		stmt.visitChildren(this);

		genPostponed(stmt);

		final int cmp = stmt.comparison();

		if (stmt.left().type().isReference()) {
			Assert.isTrue(stmt.right().type().isReference(),
					"Illegal statement: " + stmt);

			switch (cmp) {
			case IfStmt.EQ:
				opcode = Opcode.opcx_if_acmpeq;
				break;
			case IfStmt.NE:
				opcode = Opcode.opcx_if_acmpne;
				break;
			default:
				throw new RuntimeException();
			}

		} else {
			Assert.isTrue(stmt.left().type().isIntegral(),
					"Illegal statement: " + stmt);
			Assert.isTrue(stmt.right().type().isIntegral(),
					"Illegal statement: " + stmt);

			switch (cmp) {
			case IfStmt.EQ:
				opcode = Opcode.opcx_if_icmpeq;
				break;
			case IfStmt.NE:
				opcode = Opcode.opcx_if_icmpne;
				break;
			case IfStmt.GT:
				opcode = Opcode.opcx_if_icmpgt;
				break;
			case IfStmt.GE:
				opcode = Opcode.opcx_if_icmpge;
				break;
			case IfStmt.LT:
				opcode = Opcode.opcx_if_icmplt;
				break;
			case IfStmt.LE:
				opcode = Opcode.opcx_if_icmple;
				break;
			default:
				throw new RuntimeException();
			}
		}

		method.addInstruction(opcode, stmt.trueTarget().label());
		stackHeight -= 2;
	}