|
From: | Bo Lorentsen |
Subject: | Re: [glob2-devel] scripting language |
Date: | Wed, 25 May 2005 13:11:47 +0200 |
User-agent: | Debian Thunderbird 1.0.2 (X11/20050331) |
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
[Prev in Thread] | Current Thread | [Next in Thread] |