No longer let the GC replace dead keys with the LJ_TDEADKEY tag.
Important: this changes the semantics of the write barrier! Carefully read the big comment block in lj_obj.h This helps HREFK key slot specialization and allows safely hoisting HREF/HREFK across GC steps, too (fix for a barely reproducible bug). Dead keys are only removed during a table resize (as before).
This commit is contained in:
@@ -134,7 +134,7 @@ TValue *lj_meta_tset(lua_State *L, cTValue *o, cTValue *k)
|
||||
TValue *tv = lj_tab_set(L, t, k);
|
||||
if (!tvisnil(tv) ||
|
||||
!(mo = lj_meta_fast(L, tabref(t->metatable), MM_newindex))) {
|
||||
if (isblack(obj2gco(t))) lj_gc_barrierback(G(L), t);
|
||||
lj_gc_anybarriert(L, t);
|
||||
return tv;
|
||||
}
|
||||
} else if (tvisnil(mo = lj_meta_lookup(L, o, MM_newindex))) {
|
||||
|
||||
Reference in New Issue
Block a user