FFI: Drop IR_CNEWI. Add IR_CNEWP only for pointers/refs.
This commit is contained in:
@@ -153,7 +153,7 @@ typedef IRRef (LJ_FASTCALL *FoldFunc)(jit_State *J);
|
||||
#define gcstep_barrier(J, ref) \
|
||||
((ref) < J->chain[IR_LOOP] && \
|
||||
(J->chain[IR_SNEW] || J->chain[IR_TNEW] || J->chain[IR_TDUP] || \
|
||||
J->chain[IR_CNEW] || J->chain[IR_CNEWI] || J->chain[IR_TOSTR]))
|
||||
J->chain[IR_CNEW] || J->chain[IR_CNEWP] || J->chain[IR_TOSTR]))
|
||||
|
||||
/* -- Constant folding for FP numbers ------------------------------------- */
|
||||
|
||||
@@ -1587,35 +1587,26 @@ LJFOLDF(fload_str_len_snew)
|
||||
|
||||
/* The C type ID of cdata objects is immutable. */
|
||||
LJFOLD(FLOAD CNEW IRFL_CDATA_TYPEID)
|
||||
LJFOLD(FLOAD CNEWI IRFL_CDATA_TYPEID)
|
||||
LJFOLD(FLOAD CNEWP IRFL_CDATA_TYPEID)
|
||||
LJFOLDF(fload_cdata_typeid_cnewi)
|
||||
{
|
||||
if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD))
|
||||
return fleft->op2; /* No PHI barrier needed. CNEW/CNEWI op2 is const. */
|
||||
return fleft->op1; /* No PHI barrier needed. CNEW/CNEWP op1 is const. */
|
||||
return NEXTFOLD;
|
||||
}
|
||||
|
||||
/* Fixed initializers in cdata objects are immutable. */
|
||||
LJFOLD(FLOAD CNEWI IRFL_CDATA_INIT1)
|
||||
LJFOLD(FLOAD CNEWI IRFL_CDATA_INIT2_4)
|
||||
LJFOLD(FLOAD CNEWI IRFL_CDATA_INIT2_8)
|
||||
LJFOLDF(fload_cdata_init_cnew)
|
||||
/* Pointer cdata objects are immutable. */
|
||||
LJFOLD(FLOAD CNEWP IRFL_CDATA_PTR)
|
||||
LJFOLDF(fload_cdata_ptr_cnewi)
|
||||
{
|
||||
if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) {
|
||||
IRIns *ir = fleft;
|
||||
/* Fold even across PHI to avoid expensive allocations. */
|
||||
lua_assert(ir->op1 != REF_NIL);
|
||||
if (IR(ir->op1)->o == IR_CARG) ir = IR(ir->op1);
|
||||
return fins->op2 == IRFL_CDATA_INIT1 ? ir->op1 : ir->op2;
|
||||
}
|
||||
if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD))
|
||||
return fleft->op2; /* Fold even across PHI to avoid allocations. */
|
||||
return NEXTFOLD;
|
||||
}
|
||||
|
||||
LJFOLD(FLOAD any IRFL_STR_LEN)
|
||||
LJFOLD(FLOAD any IRFL_CDATA_TYPEID)
|
||||
LJFOLD(FLOAD any IRFL_CDATA_INIT1)
|
||||
LJFOLD(FLOAD any IRFL_CDATA_INIT2_4)
|
||||
LJFOLD(FLOAD any IRFL_CDATA_INIT2_8)
|
||||
LJFOLD(FLOAD any IRFL_CDATA_PTR)
|
||||
LJFOLD(VLOAD any any) /* Vararg loads have no corresponding stores. */
|
||||
LJFOLDX(lj_opt_cse)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user