aboutsummaryrefslogtreecommitdiff
path: root/src/lj_asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r--src/lj_asm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index 6d42cf35..eeb6aeb4 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -1852,6 +1852,8 @@ static void asm_sload(ASMState *as, IRIns *ir)
1852 IRType1 t = ir->t; 1852 IRType1 t = ir->t;
1853 Reg base; 1853 Reg base;
1854 lua_assert(!(ir->op2 & IRSLOAD_PARENT)); /* Handled by asm_head_side(). */ 1854 lua_assert(!(ir->op2 & IRSLOAD_PARENT)); /* Handled by asm_head_side(). */
1855 lua_assert(!irt_isguard(ir->t) ==
1856 !((ir->op2 & IRSLOAD_TYPECHECK) || irt_isint(t)));
1855 if (irt_isint(t)) { 1857 if (irt_isint(t)) {
1856 Reg left = ra_scratch(as, RSET_FPR); 1858 Reg left = ra_scratch(as, RSET_FPR);
1857 asm_tointg(as, ir, left); /* Frees dest reg. Do this before base alloc. */ 1859 asm_tointg(as, ir, left); /* Frees dest reg. Do this before base alloc. */
@@ -1865,11 +1867,11 @@ static void asm_sload(ASMState *as, IRIns *ir)
1865 base = ra_alloc1(as, REF_BASE, RSET_GPR); 1867 base = ra_alloc1(as, REF_BASE, RSET_GPR);
1866 emit_movrmro(as, dest, base, ofs); 1868 emit_movrmro(as, dest, base, ofs);
1867 } else { 1869 } else {
1868 if (!irt_isguard(ir->t)) 1870 if (!(ir->op2 & IRSLOAD_TYPECHECK))
1869 return; /* No type check: avoid base alloc. */ 1871 return; /* No type check: avoid base alloc. */
1870 base = ra_alloc1(as, REF_BASE, RSET_GPR); 1872 base = ra_alloc1(as, REF_BASE, RSET_GPR);
1871 } 1873 }
1872 if (irt_isguard(ir->t)) { 1874 if ((ir->op2 & IRSLOAD_TYPECHECK)) {
1873 /* Need type check, even if the load result is unused. */ 1875 /* Need type check, even if the load result is unused. */
1874 asm_guardcc(as, irt_isnum(t) ? CC_A : CC_NE); 1876 asm_guardcc(as, irt_isnum(t) ? CC_A : CC_NE);
1875 emit_i8(as, ~irt_type(t)); 1877 emit_i8(as, ~irt_type(t));