diff options
author | Mike Pall <mike> | 2011-05-27 01:56:25 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-05-27 01:56:25 +0200 |
commit | 46955be1e2cbd3406bbc8209dbece7238a984835 (patch) | |
tree | dba6dc92268c81a1313aeb2b890be324752d838d /src | |
parent | 840a067d4e3538ab7887d128a817be44333684d6 (diff) | |
download | luajit-46955be1e2cbd3406bbc8209dbece7238a984835.tar.gz luajit-46955be1e2cbd3406bbc8209dbece7238a984835.tar.bz2 luajit-46955be1e2cbd3406bbc8209dbece7238a984835.zip |
Fix handling of number constants in snapshots in SPLIT pass.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_opt_split.c | 15 | ||||
-rw-r--r-- | src/lj_snap.c | 5 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/lj_opt_split.c b/src/lj_opt_split.c index b9fae10f..07c52564 100644 --- a/src/lj_opt_split.c +++ b/src/lj_opt_split.c | |||
@@ -255,8 +255,10 @@ static void split_ir(jit_State *J) | |||
255 | if (irm12->op1 > J->loopref && irl1->o == IR_CALLN && | 255 | if (irm12->op1 > J->loopref && irl1->o == IR_CALLN && |
256 | irl1->op2 == IRCALL_log2) { | 256 | irl1->op2 == IRCALL_log2) { |
257 | IRRef tmp = irl1->op1; /* Recycle first two args from LOG2. */ | 257 | IRRef tmp = irl1->op1; /* Recycle first two args from LOG2. */ |
258 | tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, irm3->op2); | 258 | IRRef arg3 = irm3->op2, arg4 = irm4->op2; |
259 | tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, irm4->op2); | 259 | J->cur.nins--; |
260 | tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, arg3); | ||
261 | tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, arg4); | ||
260 | ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, IRCALL_pow); | 262 | ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, IRCALL_pow); |
261 | hi = split_emit(J, IRT(IR_HIOP, LJ_SOFTFP), tmp, tmp); | 263 | hi = split_emit(J, IRT(IR_HIOP, LJ_SOFTFP), tmp, tmp); |
262 | break; | 264 | break; |
@@ -278,7 +280,7 @@ static void split_ir(jit_State *J) | |||
278 | hisubst[ir->op1], hisubst[ir->op2]); | 280 | hisubst[ir->op1], hisubst[ir->op2]); |
279 | break; | 281 | break; |
280 | case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: | 282 | case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: |
281 | case IR_MIN: case IR_MAX: | 283 | case IR_MIN: case IR_MAX: case IR_STRTO: |
282 | hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref); | 284 | hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref); |
283 | break; | 285 | break; |
284 | case IR_XLOAD: | 286 | case IR_XLOAD: |
@@ -581,7 +583,12 @@ static void split_ir(jit_State *J) | |||
581 | snap->ref = oir[snap->ref].prev; | 583 | snap->ref = oir[snap->ref].prev; |
582 | for (n = 0; n < nent; n++) { | 584 | for (n = 0; n < nent; n++) { |
583 | SnapEntry sn = map[n]; | 585 | SnapEntry sn = map[n]; |
584 | map[n] = ((sn & 0xffff0000) | oir[snap_ref(sn)].prev); | 586 | IRIns *ir = &oir[snap_ref(sn)]; |
587 | if (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM) && irref_isk(snap_ref(sn))) | ||
588 | map[n] = ((sn & 0xffff0000) | | ||
589 | (IRRef1)lj_ir_k64(J, IR_KNUM, ir_knum(ir))); | ||
590 | else | ||
591 | map[n] = ((sn & 0xffff0000) | ir->prev); | ||
585 | } | 592 | } |
586 | } | 593 | } |
587 | } | 594 | } |
diff --git a/src/lj_snap.c b/src/lj_snap.c index 1af7ef85..5fc90d8c 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c | |||
@@ -72,7 +72,7 @@ static MSize snapshot_slots(jit_State *J, SnapEntry *map, BCReg nslots) | |||
72 | (ir->op2 & (IRSLOAD_READONLY|IRSLOAD_PARENT)) != IRSLOAD_PARENT) | 72 | (ir->op2 & (IRSLOAD_READONLY|IRSLOAD_PARENT)) != IRSLOAD_PARENT) |
73 | sn |= SNAP_NORESTORE; | 73 | sn |= SNAP_NORESTORE; |
74 | } | 74 | } |
75 | if (LJ_SOFTFP && !irref_isk(ref) && irt_isnum(ir->t)) | 75 | if (LJ_SOFTFP && irt_isnum(ir->t)) |
76 | sn |= SNAP_SOFTFPNUM; | 76 | sn |= SNAP_SOFTFPNUM; |
77 | map[n++] = sn; | 77 | map[n++] = sn; |
78 | } | 78 | } |
@@ -316,7 +316,8 @@ void lj_snap_regspmap(uint16_t *rsmap, GCtrace *T, SnapNo snapno, int hi) | |||
316 | for (n = 0; n < nent; n++) { | 316 | for (n = 0; n < nent; n++) { |
317 | SnapEntry sn = map[n]; | 317 | SnapEntry sn = map[n]; |
318 | IRRef ref = snap_ref(sn); | 318 | IRRef ref = snap_ref(sn); |
319 | if ((LJ_SOFTFP && hi) ? (ref++, (sn & SNAP_SOFTFPNUM)) : !irref_isk(ref)) { | 319 | if (!irref_isk(ref) && |
320 | ((LJ_SOFTFP && hi) ? (ref++, (sn & SNAP_SOFTFPNUM)) : 1)) { | ||
320 | IRIns *ir = &T->ir[ref]; | 321 | IRIns *ir = &T->ir[ref]; |
321 | uint32_t rs = ir->prev; | 322 | uint32_t rs = ir->prev; |
322 | if (bloomtest(rfilt, ref)) | 323 | if (bloomtest(rfilt, ref)) |