diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-04-17 18:48:38 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-04-17 19:50:30 -0400 |
commit | 90e0ece0f88d13cf703cc2831f7f9b772b81b4ed (patch) | |
tree | c8e4ce4e2021bc535dffbd20ae1393bd2fe71b60 /rts/STM.c | |
parent | 45662404780b4968b5308ad969e233ffeb175c9a (diff) | |
download | haskell-wip/gc/ben.tar.gz |
Remove redundant write barrier checks and fix predictionwip/gc/ben
Diffstat (limited to 'rts/STM.c')
-rw-r--r-- | rts/STM.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -297,7 +297,7 @@ static StgClosure *lock_tvar(Capability *cap, } while (cas((void *)&(s -> current_value), (StgWord)result, (StgWord)trec) != (StgWord)result); - if (nonmoving_write_barrier_enabled && result) { + if (RTS_UNLIKELY(nonmoving_write_barrier_enabled && result)) { updateRemembSetPushClosure(cap, result); } return result; @@ -323,7 +323,7 @@ static StgBool cond_lock_tvar(Capability *cap, TRACE("%p : cond_lock_tvar(%p, %p)", trec, s, expected); w = cas((void *)&(s -> current_value), (StgWord)expected, (StgWord)trec); result = (StgClosure *)w; - if (nonmoving_write_barrier_enabled && result) { + if (RTS_UNLIKELY(nonmoving_write_barrier_enabled && result)) { updateRemembSetPushClosure(cap, expected); } TRACE("%p : %s", trec, result ? "success" : "failure"); |