diff options
author | Mike Pall <mike> | 2023-12-23 19:15:57 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2023-12-23 19:15:57 +0100 |
commit | e02a207909f5fb8dc1e58a999b6af0e346cd17e2 (patch) | |
tree | ed0cbaa7f2a0ae32f1ca50c61751f2142f759b8f /src | |
parent | 29b0b282f59ac533313199f4f7be79490b7eee51 (diff) | |
parent | c42c62e71a45a677b8b1cbf749bd33cf4d5918ff (diff) | |
download | luajit-e02a207909f5fb8dc1e58a999b6af0e346cd17e2.tar.gz luajit-e02a207909f5fb8dc1e58a999b6af0e346cd17e2.tar.bz2 luajit-e02a207909f5fb8dc1e58a999b6af0e346cd17e2.zip |
Merge branch 'master' into v2.1
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_opt_mem.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/lj_opt_mem.c b/src/lj_opt_mem.c index 631ac9e4..55b40c3b 100644 --- a/src/lj_opt_mem.c +++ b/src/lj_opt_mem.c | |||
@@ -217,25 +217,23 @@ static TRef fwd_ahload(jit_State *J, IRRef xref) | |||
217 | } | 217 | } |
218 | ref = store->prev; | 218 | ref = store->prev; |
219 | } | 219 | } |
220 | if (ir->o == IR_TNEW && !irt_isnil(fins->t)) | 220 | /* Simplified here: let loop_unroll() figure out any type instability. */ |
221 | return 0; /* Type instability in loop-carried dependency. */ | 221 | if (ir->o == IR_TNEW) { |
222 | if (irt_ispri(fins->t)) { | 222 | return TREF_NIL; |
223 | return TREF_PRI(irt_type(fins->t)); | 223 | } else { |
224 | } else if (irt_isnum(fins->t) || (LJ_DUALNUM && irt_isint(fins->t)) || | ||
225 | irt_isstr(fins->t)) { | ||
226 | TValue keyv; | 224 | TValue keyv; |
227 | cTValue *tv; | 225 | cTValue *tv; |
228 | IRIns *key = IR(xr->op2); | 226 | IRIns *key = IR(xr->op2); |
229 | if (key->o == IR_KSLOT) key = IR(key->op1); | 227 | if (key->o == IR_KSLOT) key = IR(key->op1); |
230 | lj_ir_kvalue(J->L, &keyv, key); | 228 | lj_ir_kvalue(J->L, &keyv, key); |
231 | tv = lj_tab_get(J->L, ir_ktab(IR(ir->op1)), &keyv); | 229 | tv = lj_tab_get(J->L, ir_ktab(IR(ir->op1)), &keyv); |
232 | if (itype2irt(tv) != irt_type(fins->t)) | 230 | if (tvispri(tv)) |
233 | return 0; /* Type instability in loop-carried dependency. */ | 231 | return TREF_PRI(itype2irt(tv)); |
234 | if (irt_isnum(fins->t)) | 232 | else if (tvisnum(tv)) |
235 | return lj_ir_knum_u64(J, tv->u64); | 233 | return lj_ir_knum_u64(J, tv->u64); |
236 | else if (LJ_DUALNUM && irt_isint(fins->t)) | 234 | else if (tvisint(tv)) |
237 | return lj_ir_kint(J, intV(tv)); | 235 | return lj_ir_kint(J, intV(tv)); |
238 | else | 236 | else if (tvisgcv(tv)) |
239 | return lj_ir_kstr(J, strV(tv)); | 237 | return lj_ir_kstr(J, strV(tv)); |
240 | } | 238 | } |
241 | /* Othwerwise: don't intern as a constant. */ | 239 | /* Othwerwise: don't intern as a constant. */ |