Specialize bytecode for pairs()/next() iterator. Speedup: 3.5x.

Parser predict pairs/next and emits specialized bytecode.
Bytecode is descpecialized at runtime if the prediction was wrong.
Store slot index in hidden control var to avoid key lookups.
This commit is contained in:
Mike Pall
2010-09-30 21:55:32 +02:00
parent fce05fd6e1
commit ac76493df1
9 changed files with 634 additions and 354 deletions

View File

@@ -2450,6 +2450,14 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| ins_call
break;
case BC_ITERN:
| NYI
break;
case BC_ISNEXT:
| NYI
break;
case BC_VARG:
| // RA = base*8, RB = (nresults+1)*8, RC = numparams*8
| lwz TMP0, FRAME_PC(BASE)