[Mono-list] Making a ruby.net compiler

Michal Moskal malekith@pld-linux.org
Sun, 11 May 2003 19:04:01 +0200


On Sat, May 10, 2003 at 02:05:22PM -0400, Miguel de Icaza wrote:
> Hello!
> 
>     This morning (which is absolutely beautiful here in Boston) I woke
> up with an idea to implement some of Fergus' comments:
> 
> > Sure, but no CIL implementations thus far are capable of making more
> > significant changes, such as changing data representations to replace a
> > class hierarchy with the use of tag bits for representing discriminated
> > unions.  Nor does it look like we'll see this in the near future.
> 
>     And I figured: there is really nothing that prevents the runtime to
> pick a few bits as tags on pointers to implement "isinst class".

Why not simply replace calls to typeof-runtime-function with loading
constants, when jiting method (assuming given class is already loaded)?

<as-an-option>
If class "foo" is not loaded replace calls to typeof("foo") with
unconditional branch to special piece of code, that calls runtime function
to get foo type and changes machine code for this unconditional branch
with load constant instruction, and jump to it back.
</as-an-option>

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::::: Wroclaw University, CS Dept : {E-,w}-- {b++,e}>+++ h