>>>>> "NI" == Nick Ing-Simmons <[EMAIL PROTECTED]> writes:
NI> The "overhead of op dispatch" is a self-proving issue - if you
NI> have complex ops they are expensive to dispatch.
but as someone else said, we can design our own ops to be as high level
as we want. lowering the number of op calls is the key. that loop will
be a bottleneck as it is in perl5 unless we optimize it now.
NI> With a 16-bit opcode as-per-Uri that becomes:
NI> while (1) *(table[*op_ptr++])();
NI> (Assuming we don't need to check bounds 'cos we won't generate bad code...)
i dropped the 16 bit idea in favor of an extension byte code that zhong
mentioned. it has several wins, no ordering issues, it is pure 'byte'
code.
NI> One can then start adding decode to the loop:
NI> while (1) {
NI> op_t op = *op_ptr++;
NI> switch(NUM_ARGS(op))
no switch, a simple lookup table:
op_cnt = op_counts[ op ] ;
NI> *(table[FUNC_NUM(op)])(*op_ptr++);
i don't have the c code in mind for that. something that uses op_cnt and
passes in that many args.
op_ptr += op_cnt;
uri
--
Uri Guttman --------- [EMAIL PROTECTED] ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info: http://www.sysarch.com/perl/OOP_class.html