avoid extra joinpoint and loop for list refcounting

This commit is contained in:
Brendan Hansknecht 2024-07-12 16:53:05 -07:00
parent 0d083bc192
commit afda757433
No known key found for this signature in database
GPG key ID: 0EA784685083E75B

View file

@ -77,7 +77,9 @@ pub fn refcount_stmt<'a>(
ModifyRc::DecRef(structure) => {
match layout_interner.get_repr(layout) {
// Str has no children, so Dec is the same as DecRef.
LayoutRepr::Builtin(Builtin::Str) => {
// List has children, but it is dealt with by LowLevel::ListDecRef.
// It correctly handles both Dec and DecRef
LayoutRepr::Builtin(Builtin::Str | Builtin::List(_)) => {
ctx.op = HelperOp::Dec;
refcount_stmt(
root,