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

@@ -2477,6 +2477,8 @@ void lj_record_ins(jit_State *J)
break;
}
/* fallthrough */
case BC_ITERN:
case BC_ISNEXT:
case BC_CAT:
case BC_UCLO:
case BC_FNEW: