summaryrefslogtreecommitdiff
path: root/src/lj_crecord.c
diff options
context:
space:
mode:
authorMike Pall <mike>2012-07-20 18:54:52 +0200
committerMike Pall <mike>2012-07-20 18:54:52 +0200
commit3636a720a57adefb84c7ac70b68f640caf47f27f (patch)
tree26959ea44d123b9a2361b8cd7fe5962acbd88502 /src/lj_crecord.c
parent834ff6d36d85f75d1c11c4d83dc6f56f726b7419 (diff)
downloadluajit-3636a720a57adefb84c7ac70b68f640caf47f27f.tar.gz
luajit-3636a720a57adefb84c7ac70b68f640caf47f27f.tar.bz2
luajit-3636a720a57adefb84c7ac70b68f640caf47f27f.zip
Turn loads from immutable upvalues into constants.
Diffstat (limited to 'src/lj_crecord.c')
-rw-r--r--src/lj_crecord.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c
index 49b2341a..2a475035 100644
--- a/src/lj_crecord.c
+++ b/src/lj_crecord.c
@@ -483,16 +483,8 @@ static void crec_index_meta(jit_State *J, CTState *cts, CType *ct,
483 } else if (rd->data == 0 && tvistab(tv) && tref_isstr(J->base[1])) { 483 } else if (rd->data == 0 && tvistab(tv) && tref_isstr(J->base[1])) {
484 /* Specialize to result of __index lookup. */ 484 /* Specialize to result of __index lookup. */
485 cTValue *o = lj_tab_get(J->L, tabV(tv), &rd->argv[1]); 485 cTValue *o = lj_tab_get(J->L, tabV(tv), &rd->argv[1]);
486 IRType t = itype2irt(o); 486 J->base[0] = lj_record_constify(J, o);
487 if (tvisgcv(o)) 487 if (!J->base[0])
488 J->base[0] = lj_ir_kgc(J, gcV(o), t);
489 else if (tvisint(o))
490 J->base[0] = lj_ir_kint(J, intV(o));
491 else if (tvisnum(o))
492 J->base[0] = lj_ir_knumint(J, numV(o));
493 else if (tvisbool(o))
494 J->base[0] = TREF_PRI(t);
495 else
496 lj_trace_err(J, LJ_TRERR_BADTYPE); 488 lj_trace_err(J, LJ_TRERR_BADTYPE);
497 /* Always specialize to the key. */ 489 /* Always specialize to the key. */
498 emitir(IRTG(IR_EQ, IRT_STR), J->base[1], lj_ir_kstr(J, strV(&rd->argv[1]))); 490 emitir(IRTG(IR_EQ, IRT_STR), J->base[1], lj_ir_kstr(J, strV(&rd->argv[1])));