Optimize table length computation with hinting.
10x faster on loop with t[#t+1] = x idiom. Also used by table.insert.
This commit is contained in:
@@ -78,8 +78,7 @@ static void sink_mark_ins(jit_State *J)
|
||||
switch (ir->o) {
|
||||
case IR_BASE:
|
||||
return; /* Finished. */
|
||||
case IR_CALLL: /* IRCALL_lj_tab_len */
|
||||
case IR_ALOAD: case IR_HLOAD: case IR_XLOAD: case IR_TBAR:
|
||||
case IR_ALOAD: case IR_HLOAD: case IR_XLOAD: case IR_TBAR: case IR_ALEN:
|
||||
irt_setmark(IR(ir->op1)->t); /* Mark ref for remaining loads. */
|
||||
break;
|
||||
case IR_FLOAD:
|
||||
|
||||
Reference in New Issue
Block a user