Redesign and harden string interning.
Up to 40% faster on hash-intensive benchmarks. With some ideas from Sokolov Yura.
This commit is contained in:
@@ -847,9 +847,9 @@ static void asm_href(ASMState *as, IRIns *ir, IROp merge)
|
||||
emit_dnm(as, A64I_ANDw, dest, dest, tmphash);
|
||||
emit_lso(as, A64I_LDRw, dest, tab, offsetof(GCtab, hmask));
|
||||
} else if (irt_isstr(kt)) {
|
||||
/* Fetch of str->hash is cheaper than ra_allock. */
|
||||
/* Fetch of str->sid is cheaper than ra_allock. */
|
||||
emit_dnm(as, A64I_ANDw, dest, dest, tmp);
|
||||
emit_lso(as, A64I_LDRw, tmp, key, offsetof(GCstr, hash));
|
||||
emit_lso(as, A64I_LDRw, tmp, key, offsetof(GCstr, sid));
|
||||
emit_lso(as, A64I_LDRw, dest, tab, offsetof(GCtab, hmask));
|
||||
} else { /* Must match with hash*() in lj_tab.c. */
|
||||
emit_dnm(as, A64I_ANDw, dest, dest, tmp);
|
||||
|
||||
Reference in New Issue
Block a user