Stephane Magnenat wrote:
Just a question about vm: How do you plan choose each bytecode and increment
PC? Most vm (specially C ones) have a big switch to execute bytecode, but
using inheritance of a class ByteCode with a virtual method execute is
usually faster. Furthermore, this method can return the relative displacement
that PC should do. Martin V. knows more than me about this.
Hmm, good idea ... I will try to think about it.
The reason why I use a switch right now, is to maintain some scope
related states (stack frame, return addr and more) in the same function.
The price for a indirect function call is somewhat high as far as I
know, so what I really need is a measuring of switch (between about 30+
items) versus virtual member function call.
Worth considering ! But as the VM part is the simple part of the job I
could try both, later :-)
/BL
_______________________________________________
glob2-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/glob2-devel