mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
use recursive touch for inc/decref
This commit is contained in:
parent
e69e9736b5
commit
4f20cd4928
1 changed files with 4 additions and 5 deletions
|
@ -218,8 +218,9 @@ fn stmt_spec(
|
||||||
ModifyRc::Inc(symbol, _) => {
|
ModifyRc::Inc(symbol, _) => {
|
||||||
let argument = env.symbols[symbol];
|
let argument = env.symbols[symbol];
|
||||||
|
|
||||||
// inc is non-recursive
|
// a recursive touch is never worse for optimizations than a normal touch
|
||||||
builder.add_touch(block, argument)?;
|
// and a bit more permissive in its type
|
||||||
|
builder.add_recursive_touch(block, argument)?;
|
||||||
|
|
||||||
stmt_spec(builder, env, block, layout, continuation)
|
stmt_spec(builder, env, block, layout, continuation)
|
||||||
}
|
}
|
||||||
|
@ -227,7 +228,6 @@ fn stmt_spec(
|
||||||
ModifyRc::Dec(symbol) => {
|
ModifyRc::Dec(symbol) => {
|
||||||
let argument = env.symbols[symbol];
|
let argument = env.symbols[symbol];
|
||||||
|
|
||||||
// dec may be recursive
|
|
||||||
builder.add_recursive_touch(block, argument)?;
|
builder.add_recursive_touch(block, argument)?;
|
||||||
|
|
||||||
stmt_spec(builder, env, block, layout, continuation)
|
stmt_spec(builder, env, block, layout, continuation)
|
||||||
|
@ -235,8 +235,7 @@ fn stmt_spec(
|
||||||
ModifyRc::DecRef(symbol) => {
|
ModifyRc::DecRef(symbol) => {
|
||||||
let argument = env.symbols[symbol];
|
let argument = env.symbols[symbol];
|
||||||
|
|
||||||
// decref is non-recursive
|
builder.add_recursive_touch(block, argument)?;
|
||||||
builder.add_touch(block, argument)?;
|
|
||||||
|
|
||||||
stmt_spec(builder, env, block, layout, continuation)
|
stmt_spec(builder, env, block, layout, continuation)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue