On Tue, 5 Jun 2001, Dave Mitchell wrote:
> dispatch loop. I'd much rather have a 'regex start' opcode which
> calls a separate dispath loop function, and which then interprets any
> further ops in the bytestream as regex ops. That way we double the number
> of 8-bit ops, and can have all the regex-specific state variables (s, send
> etc in the earlier example) and logic separated out.
This is an interesting idea...could we use this more generally to
multiply our number of opcodes? Basically, you have one set of opcodes
for (e.g.) string parsing, one set for math, etc, all of which have the
same value. Then you have a set of opcodes that tells the interpreter
which opcode table to look in. The 'switching' opcodes then become
overhead, but if there aren't too many of those, perhaps its
acceptable. And it would mean that we could specialize the opcodes a
great deal more (if, of course, that is desirable), and still have them
fit in an octet.
(Sorry if this is a stupid question, but please be patient; I've
never done internals stuff before.)
Dave