aboutsummaryrefslogtreecommitdiff
path: root/src/lj_opt_split.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_opt_split.c')
-rw-r--r--src/lj_opt_split.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lj_opt_split.c b/src/lj_opt_split.c
index 7925cfa5..798a02cc 100644
--- a/src/lj_opt_split.c
+++ b/src/lj_opt_split.c
@@ -235,7 +235,7 @@ static IRRef split_bitshift(jit_State *J, IRRef1 *hisubst,
235 return split_emit(J, IRTI(IR_BOR), t1, t2); 235 return split_emit(J, IRTI(IR_BOR), t1, t2);
236 } else { 236 } else {
237 IRRef t1 = ir->prev, t2; 237 IRRef t1 = ir->prev, t2;
238 lua_assert(op == IR_BSHR || op == IR_BSAR); 238 lj_assertJ(op == IR_BSHR || op == IR_BSAR, "bad usage");
239 nir->o = IR_BSHR; 239 nir->o = IR_BSHR;
240 t2 = split_emit(J, IRTI(IR_BSHL), hi, lj_ir_kint(J, (-k&31))); 240 t2 = split_emit(J, IRTI(IR_BSHL), hi, lj_ir_kint(J, (-k&31)));
241 ir->prev = split_emit(J, IRTI(IR_BOR), t1, t2); 241 ir->prev = split_emit(J, IRTI(IR_BOR), t1, t2);
@@ -250,7 +250,7 @@ static IRRef split_bitshift(jit_State *J, IRRef1 *hisubst,
250 ir->prev = lj_ir_kint(J, 0); 250 ir->prev = lj_ir_kint(J, 0);
251 return lo; 251 return lo;
252 } else { 252 } else {
253 lua_assert(op == IR_BSHR || op == IR_BSAR); 253 lj_assertJ(op == IR_BSHR || op == IR_BSAR, "bad usage");
254 if (k == 32) { 254 if (k == 32) {
255 J->cur.nins--; 255 J->cur.nins--;
256 ir->prev = hi; 256 ir->prev = hi;
@@ -429,7 +429,7 @@ static void split_ir(jit_State *J)
429 hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref); 429 hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref);
430 break; 430 break;
431 case IR_FLOAD: 431 case IR_FLOAD:
432 lua_assert(ir->op1 == REF_NIL); 432 lj_assertJ(ir->op1 == REF_NIL, "expected FLOAD from GG_State");
433 hi = lj_ir_kint(J, *(int32_t*)((char*)J2GG(J) + ir->op2 + LJ_LE*4)); 433 hi = lj_ir_kint(J, *(int32_t*)((char*)J2GG(J) + ir->op2 + LJ_LE*4));
434 nir->op2 += LJ_BE*4; 434 nir->op2 += LJ_BE*4;
435 break; 435 break;
@@ -465,8 +465,9 @@ static void split_ir(jit_State *J)
465 break; 465 break;
466 } 466 }
467#endif 467#endif
468 lua_assert(st == IRT_INT || 468 lj_assertJ(st == IRT_INT ||
469 (LJ_32 && LJ_HASFFI && (st == IRT_U32 || st == IRT_FLOAT))); 469 (LJ_32 && LJ_HASFFI && (st == IRT_U32 || st == IRT_FLOAT)),
470 "bad source type for CONV");
470 nir->o = IR_CALLN; 471 nir->o = IR_CALLN;
471#if LJ_32 && LJ_HASFFI 472#if LJ_32 && LJ_HASFFI
472 nir->op2 = st == IRT_INT ? IRCALL_softfp_i2d : 473 nir->op2 = st == IRT_INT ? IRCALL_softfp_i2d :
@@ -496,7 +497,8 @@ static void split_ir(jit_State *J)
496 hi = nir->op2; 497 hi = nir->op2;
497 break; 498 break;
498 default: 499 default:
499 lua_assert(ir->o <= IR_NE || ir->o == IR_MIN || ir->o == IR_MAX); 500 lj_assertJ(ir->o <= IR_NE || ir->o == IR_MIN || ir->o == IR_MAX,
501 "bad IR op %d", ir->o);
500 hi = split_emit(J, IRTG(IR_HIOP, IRT_SOFTFP), 502 hi = split_emit(J, IRTG(IR_HIOP, IRT_SOFTFP),
501 hisubst[ir->op1], hisubst[ir->op2]); 503 hisubst[ir->op1], hisubst[ir->op2]);
502 break; 504 break;
@@ -553,7 +555,7 @@ static void split_ir(jit_State *J)
553 hi = split_bitshift(J, hisubst, oir, nir, ir); 555 hi = split_bitshift(J, hisubst, oir, nir, ir);
554 break; 556 break;
555 case IR_FLOAD: 557 case IR_FLOAD:
556 lua_assert(ir->op2 == IRFL_CDATA_INT64); 558 lj_assertJ(ir->op2 == IRFL_CDATA_INT64, "only INT64 supported");
557 hi = split_emit(J, IRTI(IR_FLOAD), nir->op1, IRFL_CDATA_INT64_4); 559 hi = split_emit(J, IRTI(IR_FLOAD), nir->op1, IRFL_CDATA_INT64_4);
558#if LJ_BE 560#if LJ_BE
559 ir->prev = hi; hi = nref; 561 ir->prev = hi; hi = nref;
@@ -619,7 +621,7 @@ static void split_ir(jit_State *J)
619 hi = nir->op2; 621 hi = nir->op2;
620 break; 622 break;
621 default: 623 default:
622 lua_assert(ir->o <= IR_NE); /* Comparisons. */ 624 lj_assertJ(ir->o <= IR_NE, "bad IR op %d", ir->o); /* Comparisons. */
623 split_emit(J, IRTGI(IR_HIOP), hiref, hisubst[ir->op2]); 625 split_emit(J, IRTGI(IR_HIOP), hiref, hisubst[ir->op2]);
624 break; 626 break;
625 } 627 }
@@ -697,7 +699,7 @@ static void split_ir(jit_State *J)
697#if LJ_SOFTFP 699#if LJ_SOFTFP
698 if (st == IRT_NUM || (LJ_32 && LJ_HASFFI && st == IRT_FLOAT)) { 700 if (st == IRT_NUM || (LJ_32 && LJ_HASFFI && st == IRT_FLOAT)) {
699 if (irt_isguard(ir->t)) { 701 if (irt_isguard(ir->t)) {
700 lua_assert(st == IRT_NUM && irt_isint(ir->t)); 702 lj_assertJ(st == IRT_NUM && irt_isint(ir->t), "bad CONV types");
701 J->cur.nins--; 703 J->cur.nins--;
702 ir->prev = split_num2int(J, nir->op1, hisubst[ir->op1], 1); 704 ir->prev = split_num2int(J, nir->op1, hisubst[ir->op1], 1);
703 } else { 705 } else {
@@ -828,7 +830,7 @@ void lj_opt_split(jit_State *J)
828 if (!J->needsplit) 830 if (!J->needsplit)
829 J->needsplit = split_needsplit(J); 831 J->needsplit = split_needsplit(J);
830#else 832#else
831 lua_assert(J->needsplit >= split_needsplit(J)); /* Verify flag. */ 833 lj_assertJ(J->needsplit >= split_needsplit(J), "bad SPLIT state");
832#endif 834#endif
833 if (J->needsplit) { 835 if (J->needsplit) {
834 int errcode = lj_vm_cpcall(J->L, NULL, J, cpsplit); 836 int errcode = lj_vm_cpcall(J->L, NULL, J, cpsplit);