public void inline(Object code) {
        // First load the class for the inlined code.

        Class codeClass = code.getClass();
        String className = codeClass.getName().replace('.', '/') + ".class";
        ClassLoader loader = codeClass.getClassLoader();

        InputStream in;
        if (loader == null) {
            in = ClassLoader.getSystemResourceAsStream(className);
        } else {
            in = loader.getResourceAsStream(className);
        }

        if (in == null) {
            throw new MissingResourceException("Unable to find class file", className, null);
        }

        ClassFile cf;
        try {
            cf = ClassFile.readFrom(in);
        } catch (IOException e) {
            MissingResourceException e2 = new MissingResourceException
                ("Error loading class file: " + e.getMessage(), className, null);
            try {
                e2.initCause(e);
            } catch (NoSuchMethodError e3) {
            }
            throw e2;
        }

        // Now find the single "define" method.
        MethodInfo defineMethod = null;

        MethodInfo[] methods = cf.getMethods();
        for (int i=0; i<methods.length; i++) {
            MethodInfo method = methods[i];
            if ("define".equals(method.getName())) {
                if (defineMethod != null) {
                    throw new IllegalArgumentException("Multiple define methods found");
                } else {
                    defineMethod = method;
                }
            }
        }

        if (defineMethod == null) {
            throw new IllegalArgumentException("No define method found");
        }

        // Copy stack arguments to expected local variables.
        TypeDesc[] paramTypes = defineMethod.getMethodDescriptor().getParameterTypes();
        LocalVariable[] paramVars = new LocalVariable[paramTypes.length];
        for (int i=paramVars.length; --i>=0; ) {
            LocalVariable paramVar = createLocalVariable(paramTypes[i]);
            storeLocal(paramVar);
            paramVars[i] = paramVar;
        }

        Label returnLocation = createLabel();
        CodeDisassembler cd = new CodeDisassembler(defineMethod);
        cd.disassemble(this, paramVars, returnLocation);
        returnLocation.setLocation();
    }