FFI: FOLD load of initializers even across PHIs.

This commit is contained in:
Mike Pall 2010-12-17 16:47:28 +01:00
parent c4a0fb4f60
commit c98132e182

View File

@ -1603,7 +1603,7 @@ LJFOLDF(fload_cdata_init_cnew)
{ {
if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) { if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) {
IRIns *ir = fleft; IRIns *ir = fleft;
PHIBARRIER(fleft); /* Fold even across PHI to avoid expensive allocations. */
lua_assert(ir->op1 != REF_NIL); lua_assert(ir->op1 != REF_NIL);
if (IR(ir->op1)->o == IR_CARG) ir = IR(ir->op1); if (IR(ir->op1)->o == IR_CARG) ir = IR(ir->op1);
return fins->op2 == IRFL_CDATA_INIT1 ? ir->op1 : ir->op2; return fins->op2 == IRFL_CDATA_INIT1 ? ir->op1 : ir->op2;