method.setCompiledCode(new VmCompiledCode(this, bc, codePtr, code,
method.addCompiledCode(new VmCompiledCode(this, bc, codePtr, code,
    public void compileRuntime(VmMethod method, ObjectResolver resolver,            int level, NativeStream os) {        if (method.isNative()) { throw new IllegalArgumentException(                "Cannot compile native methods"); }        //long start = System.currentTimeMillis();        //System.out.println("Compiling " + method);        if (os == null) {            os = createNativeStream(resolver);        }        final CompiledMethod cm;        if (method.isAbstract()) {            cm = doCompileAbstract(method, os, level, false);            if (cm == null) { return; }        } else {            cm = doCompile(method, os, level, false);        }        try {            final int startOffset = cm.getCodeStart().getOffset();            final int size = cm.getCodeEnd().getOffset() - startOffset;            final byte[] code = new byte[ size];            System.arraycopy(os.getBytes(), startOffset, code, 0, size);            final Address codePtr = resolver.addressOfArrayData(code);            final NativeStream.ObjectRef defExHRef = cm                    .getDefExceptionHandler();            final Address defExHandler;            if (defExHRef != null) {                defExHandler = resolver.add(codePtr, cm                        .getDefExceptionHandler().getOffset()                        - startOffset);            } else {                defExHandler = null;            }            final VmCompiledExceptionHandler[] eTable;            final VmAddressMap aTable = cm.getAddressTable();            final VmByteCode bc = method.getBytecode();            final CompiledExceptionHandler[] ceh = cm.getExceptionHandlers();            if (ceh != null) {                eTable = new VmCompiledExceptionHandler[ ceh.length];                for (int i = 0; i < ceh.length; i++) {                    final VmConstClass catchType = bc.getExceptionHandler(i)                            .getCatchType();                    final Address startPtr = Address.add(codePtr, ceh[ i]                            .getStartPc().getOffset()                            - startOffset);                    final Address endPtr = Address.add(codePtr, ceh[ i]                            .getEndPc().getOffset()                            - startOffset);                    final Address handler = Address.add(codePtr, ceh[ i]                            .getHandler().getOffset()                            - startOffset);                    eTable[ i] = new VmCompiledExceptionHandler(catchType,                            startPtr, endPtr, handler);                }            } else {                eTable = null;            }            method.setCompiledCode(new VmCompiledCode(this, bc, codePtr, code,                    size, eTable, defExHandler, aTable), level);            // For debugging only            //System.out.println("Code: " + NumberUtils.hex(code));            //System.out.println();            //End of debugging only        } catch (UnresolvedObjectRefException ex) {            throw new CompileError(ex);        }        if (os.hasUnresolvedObjectRefs()) { throw new CompileError(                "Unresolved labels after compile!"); }    }