diff options
author | Mike Pall <mike> | 2016-05-21 00:30:36 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2016-05-21 01:00:49 +0200 |
commit | 786dbb2ebdde16eadd7464cd5cbeb5d95a5e46f0 (patch) | |
tree | 8b66463365b467be31250334ea434a2f572b3c5d /src/lj_asm_mips.h | |
parent | cfa188f1349ba4c843394b53f270cb64635b9805 (diff) | |
download | luajit-786dbb2ebdde16eadd7464cd5cbeb5d95a5e46f0.tar.gz luajit-786dbb2ebdde16eadd7464cd5cbeb5d95a5e46f0.tar.bz2 luajit-786dbb2ebdde16eadd7464cd5cbeb5d95a5e46f0.zip |
Add IR_FLOAD with REF_NIL for field loads from GG_State.
Contributed by Peter Cawley.
Diffstat (limited to 'src/lj_asm_mips.h')
-rw-r--r-- | src/lj_asm_mips.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h index d37bc132..6094be68 100644 --- a/src/lj_asm_mips.h +++ b/src/lj_asm_mips.h | |||
@@ -896,17 +896,23 @@ static MIPSIns asm_fxstoreins(IRIns *ir) | |||
896 | static void asm_fload(ASMState *as, IRIns *ir) | 896 | static void asm_fload(ASMState *as, IRIns *ir) |
897 | { | 897 | { |
898 | Reg dest = ra_dest(as, ir, RSET_GPR); | 898 | Reg dest = ra_dest(as, ir, RSET_GPR); |
899 | Reg idx = ra_alloc1(as, ir->op1, RSET_GPR); | ||
900 | MIPSIns mi = asm_fxloadins(ir); | 899 | MIPSIns mi = asm_fxloadins(ir); |
900 | Reg idx; | ||
901 | int32_t ofs; | 901 | int32_t ofs; |
902 | if (ir->op2 == IRFL_TAB_ARRAY) { | 902 | if (ir->op1 == REF_NIL) { |
903 | ofs = asm_fuseabase(as, ir->op1); | 903 | idx = RID_JGL; |
904 | if (ofs) { /* Turn the t->array load into an add for colocated arrays. */ | 904 | ofs = ir->op2 - 32768; |
905 | emit_tsi(as, MIPSI_ADDIU, dest, idx, ofs); | 905 | } else { |
906 | return; | 906 | idx = ra_alloc1(as, ir->op1, RSET_GPR); |
907 | if (ir->op2 == IRFL_TAB_ARRAY) { | ||
908 | ofs = asm_fuseabase(as, ir->op1); | ||
909 | if (ofs) { /* Turn the t->array load into an add for colocated arrays. */ | ||
910 | emit_tsi(as, MIPSI_ADDIU, dest, idx, ofs); | ||
911 | return; | ||
912 | } | ||
907 | } | 913 | } |
914 | ofs = field_ofs[ir->op2]; | ||
908 | } | 915 | } |
909 | ofs = field_ofs[ir->op2]; | ||
910 | lua_assert(!irt_isfp(ir->t)); | 916 | lua_assert(!irt_isfp(ir->t)); |
911 | emit_tsi(as, mi, dest, idx, ofs); | 917 | emit_tsi(as, mi, dest, idx, ofs); |
912 | } | 918 | } |