You might take a look at http://svn.codehaus.org/jruby/branches/bdortch/attrs/src/org/jruby/runtime/builtin-- this was my initial take on refactoring IRubyObject (including parameterizing the "base" object type for an eventual move away from requiring all objects to implement IRubyObject). I decided it was a bit much for 1.1, but maybe not. See also http://svn.codehaus.org/jruby/branches/bdortch/attrs/src/org/jruby/runtime/componentfor a plug-in implementation of ivars (I didn't get constants/cvars done as I abandoned the work at that point).
Note that the code is a little stale and probably doesn't exactly map to what got implemented in trunk. But it might serve as a useful model/reference, or at least give us something to discuss. -Bill
