VmClassLoader vmc = new VmClassLoader(new File(".").toURL(), new VmX86Architecture());
VmSystemClassLoader vmc = new VmSystemClassLoader(new File(".").toURL(), new VmX86Architecture());
	public static void main(String args[]) throws SecurityException, IOException, ClassNotFoundException {		String className = "org.jnode.vm.compiler.ir.IRGenerator";		if (args.length > 0) {			className = args[0];		}		VmClassLoader vmc = new VmClassLoader(new File(".").toURL(), new VmX86Architecture());		VmType type = vmc.loadClass(className, true);		VmMethod arithMethod = null;		int nMethods = type.getNoDeclaredMethods();		for (int i=0; i<nMethods; i+=1) {			VmMethod method = type.getDeclaredMethod(i);			if ("arithOpt".equals(method.getName())) {				arithMethod = method;				break;			}		}		VmByteCode code = arithMethod.getBytecode();		BytecodeViewer bv = new BytecodeViewer();		BytecodeParser.parse(code, bv);		System.out.println();		IRControlFlowGraph cfg = new IRControlFlowGraph(code);		// System.out.println(cfg.toString());		System.out.println();				IRGenerator irg = new IRGenerator(cfg);		BytecodeParser.parse(code, irg);		BootableArrayList iops = irg.getIOPList();		int n = iops.size();		BootableHashMap liveVariables = new BootableHashMap();		for (int i=0; i<n; i+=1) {			IOP iop = (IOP) iops.get(i);			iop.doPass2(liveVariables);		}		boolean printDeadCode = false;		boolean printDetail = false;		IRBasicBlock currentBlock = null;		for (int i=0; i<n; i+=1) {			IOP iop = (IOP) iops.get(i);			if (currentBlock != iop.getBasicBlock()) {				currentBlock = iop.getBasicBlock();				System.out.println();				System.out.println(currentBlock);			}			if (printDeadCode && iop.isDeadCode()) {				if (printDetail) {					printIOPDetail(iop);				}				System.out.println(iop);			}			if (!iop.isDeadCode()) {				if (printDetail) {					printIOPDetail(iop);				}				System.out.println(iop);			}		}		System.out.println();		System.out.println("Live ranges:");		Collection lv = liveVariables.values();		n = lv.size();		LiveRange[] liveRanges = new LiveRange[n];		Iterator it = lv.iterator();		for (int i=0; i<n; i+=1) {			Variable v = (Variable) it.next();			liveRanges[i] = new LiveRange(v);		}		Arrays.sort(liveRanges);		LinearScanAllocator lsa = new LinearScanAllocator(liveRanges, 4);		lsa.allocate();		for (int i=0; i<n; i+=1) {			System.out.println(liveRanges[i]);		}	}