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:
14
src/lj_obj.c
14
src/lj_obj.c
@@ -11,12 +11,12 @@
|
||||
/* Object type names. */
|
||||
LJ_DATADEF const char *const lj_obj_typename[] = { /* ORDER LUA_T */
|
||||
"no value", "nil", "boolean", "userdata", "number", "string",
|
||||
"table", "function", "userdata", "thread", "proto", "upval"
|
||||
"table", "function", "userdata", "thread", "proto"
|
||||
};
|
||||
|
||||
LJ_DATADEF const char *const lj_obj_itypename[] = { /* ORDER LJ_T */
|
||||
"nil", "boolean", "boolean", "userdata", "string", "upval", "thread",
|
||||
"proto", "function", "deadkey", "table", "userdata", "number"
|
||||
"proto", "function", "" /* Unused */, "table", "userdata", "number"
|
||||
};
|
||||
|
||||
/* Compare two objects without calling metamethods. */
|
||||
@@ -25,14 +25,8 @@ int lj_obj_equal(cTValue *o1, cTValue *o2)
|
||||
if (itype(o1) == itype(o2)) {
|
||||
if (tvispri(o1))
|
||||
return 1;
|
||||
if (!tvisnum(o1)) {
|
||||
#if LJ_64
|
||||
if (tvislightud(o1))
|
||||
return o1->u64 == o2->u64;
|
||||
else
|
||||
#endif
|
||||
return gcrefeq(o1->gcr, o2->gcr);
|
||||
}
|
||||
if (!tvisnum(o1))
|
||||
return gcrefeq(o1->gcr, o2->gcr);
|
||||
} else if (!tvisnum(o1) || !tvisnum(o2)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user