diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-06-15 19:07:58 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-06-15 19:07:58 +0100 |
commit | 75947bb63794cae5950f679c8df86441b736b3fa (patch) | |
tree | d99b4deb0596840c40fac73ef22344e676102d7e /rts/PrimOps.cmm | |
parent | 9a8c20d0d7956843cc7fbbd24f5592ea39c81be9 (diff) | |
download | haskell-75947bb63794cae5950f679c8df86441b736b3fa.tar.gz |
Optimise lockClosure when n_capabilities == 1; fixes #693
Based on a patch from Yuras Shumovich.
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r-- | rts/PrimOps.cmm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index c12c6d8638..a227e776a7 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -1193,7 +1193,12 @@ stg_takeMVarzh ( P_ mvar /* :: MVar a */ ) W_ val, info, tso, q; #if defined(THREADED_RTS) - ("ptr" info) = ccall lockClosure(mvar "ptr"); + if (CInt[n_capabilities] == 1 :: CInt) { + info = GET_INFO(mvar); + } + else { + ("ptr" info) = ccall reallyLockClosure(mvar "ptr"); + } #else info = GET_INFO(mvar); #endif @@ -1290,7 +1295,12 @@ stg_tryTakeMVarzh ( P_ mvar /* :: MVar a */ ) W_ val, info, tso, q; #if defined(THREADED_RTS) - ("ptr" info) = ccall lockClosure(mvar "ptr"); + if (CInt[n_capabilities] == 1 :: CInt) { + info = GET_INFO(mvar); + } + else { + ("ptr" info) = ccall reallyLockClosure(mvar "ptr"); + } #else info = GET_INFO(mvar); #endif @@ -1361,7 +1371,12 @@ stg_putMVarzh ( P_ mvar, /* :: MVar a */ W_ info, tso, q; #if defined(THREADED_RTS) - ("ptr" info) = ccall lockClosure(mvar "ptr"); + if (CInt[n_capabilities] == 1 :: CInt) { + info = GET_INFO(mvar); + } + else { + ("ptr" info) = ccall reallyLockClosure(mvar "ptr"); + } #else info = GET_INFO(mvar); #endif @@ -1454,7 +1469,12 @@ stg_tryPutMVarzh ( P_ mvar, /* :: MVar a */ W_ info, tso, q; #if defined(THREADED_RTS) - ("ptr" info) = ccall lockClosure(mvar "ptr"); + if (CInt[n_capabilities] == 1 :: CInt) { + info = GET_INFO(mvar); + } + else { + ("ptr" info) = ccall reallyLockClosure(mvar "ptr"); + } #else info = GET_INFO(mvar); #endif |