Hi Todd --

Thanks for putting up the new decaf source. I can't comment on the
architecture as I only had a short time last night to peruse the code;
besides, I find it far easier to see what's going on using a debugger, and
it doesn't run yet (does it?).

A couple of things I did notice:

1. The code would be cleaner, shorter and more flexible if you used an
ASSERT macro. For example, I saw a couple of places with this kind of thing:
        if (a) {
                b = a->blah;
                if (b) {
                        b->do_something();
                } else {
                        kprintf("no b");
                        abort();
                }
        } else {
                kprintf("no a");
                abort();
        }
with ASSERTs this becomes:
        ASSERT(a, "no a");
        b = a->blah;
        ASSERT(b, "no b");
        b->do_something();
Then when we know the code works (ie the assertions never fail), we can
simply define ASSERT to be nothing and all the checks go away. There's a
crappy assert macro in j_assert.c in the gc code; I'll try and find time
this weekend to spruce it up so it can pass variable params to kprintf.

2. There seem to be quite a few places where exceptions should be thrown
(illegal monitor state, out of memory etc) but aren't. I'd be interested in
trying to help out in this area when the interpreter's up and running.

Anyway, thanks again for the hard work!

-- George



_______________________________________________
Kernel maillist  -  [EMAIL PROTECTED]
http://jos.org/mailman/listinfo/kernel

Reply via email to