--- Dan Sugalski <dan@sidhe.org> wrote: > =head1 Stacks [snip] > The stacks are at least: > > =over 4 > > =item Temp stack > > for squirreling away the contents of individual registers > > =item Register stack > > For pushing the entire register file at once. There are > four sets, one > for each register type. > > =item state stack > > For the interpreter's internal state > > =back Perl 5-ish save stack for dynamic scoping? (whatever term replaces 'local') What is the subroutine calling convention? Caller cleans or callee cleans? > =head1 Registers > > We have four sets. Each set has 64 members Do we really need 64 ints and 64 floats? 64 stringish ones I can understand (sort of) - the RE engine could use them. Maybe only 32 each of ints and floats? Also, what about the suggestion to have the various special values (&PL_sv_undef, &PL_sv_yes, &PL_sv_yes) be registers (so undef $foo becomes 'st sp_reg0, $foo' or somesuch)? Also, what about having one or more of the registers be the 'lexical state register(s)' to inplement pragmas (or is this the state stack?)? > =head1 Opcodes > > Opcodes are all dispatched indirectly via an opcode > function > table. Each segment of bytecode (a segment roughly > corresponding to a > compilation unit--a precompiled module would be in its > own segment, > for example) has its own opcode function table. Be wary of this. I tried this in Perl 5 (on an old sun4c, granted), and I came out with something like a 5% slowdown over having the function pointer actually stored in the op, IIRC. > =head1 The opcode loop > > This is a tight loop. All it does is call an opcode > function, get back > a pointer to the next opcode to execute, and check the > event dispatch > flag. Lather, rinse, repeat ad infinitum. How does this port to a TIL form? > =head1 Bytecode Looks good from here (and a _lot_ prettier than B::Bytecode/ByteLoader!). -- BKS __________________________________________________ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/Thread Previous | Thread Next