diff options
author | Mike Pall <mike> | 2015-06-10 17:06:01 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2015-06-10 17:06:01 +0200 |
commit | 458a40b7242aefe2f0893019f0451fb2f2deccd9 (patch) | |
tree | 17faffdaf6b7268d93216bddf1f16287d532eed8 /src | |
parent | 5081e38031ea57ac06dd267093297bb353ba428b (diff) | |
download | luajit-458a40b7242aefe2f0893019f0451fb2f2deccd9.tar.gz luajit-458a40b7242aefe2f0893019f0451fb2f2deccd9.tar.bz2 luajit-458a40b7242aefe2f0893019f0451fb2f2deccd9.zip |
Fix table allocation bump optimization (sigh).
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_record.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 082f12e0..9480448f 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -1162,7 +1162,8 @@ static void rec_idx_bump(jit_State *J, RecordIndex *ix) | |||
1162 | if ((tb->asize > tpl->asize && (1u << nhbits)-1 == tpl->hmask) || | 1162 | if ((tb->asize > tpl->asize && (1u << nhbits)-1 == tpl->hmask) || |
1163 | (tb->asize == tpl->asize && (1u << nhbits)-1 > tpl->hmask)) { | 1163 | (tb->asize == tpl->asize && (1u << nhbits)-1 > tpl->hmask)) { |
1164 | Node *node = noderef(tpl->node); | 1164 | Node *node = noderef(tpl->node); |
1165 | uint32_t i, hmask = tpl->hmask; | 1165 | uint32_t i, hmask = tpl->hmask, asize; |
1166 | TValue *array; | ||
1166 | for (i = 0; i <= hmask; i++) { | 1167 | for (i = 0; i <= hmask; i++) { |
1167 | if (!tvisnil(&node[i].key) && tvisnil(&node[i].val)) | 1168 | if (!tvisnil(&node[i].key) && tvisnil(&node[i].val)) |
1168 | settabV(J->L, &node[i].val, tpl); | 1169 | settabV(J->L, &node[i].val, tpl); |
@@ -1179,6 +1180,13 @@ static void rec_idx_bump(jit_State *J, RecordIndex *ix) | |||
1179 | if (tvistab(&node[i].val)) | 1180 | if (tvistab(&node[i].val)) |
1180 | setnilV(&node[i].val); | 1181 | setnilV(&node[i].val); |
1181 | } | 1182 | } |
1183 | /* The shape of the table may have changed. Clean up array part, too. */ | ||
1184 | asize = tpl->asize; | ||
1185 | array = tvref(tpl->array); | ||
1186 | for (i = 0; i < asize; i++) { | ||
1187 | if (tvistab(&array[i])) | ||
1188 | setnilV(&array[i]); | ||
1189 | } | ||
1182 | J->retryrec = 1; /* Abort the trace at the end of recording. */ | 1190 | J->retryrec = 1; /* Abort the trace at the end of recording. */ |
1183 | } | 1191 | } |
1184 | } | 1192 | } |