[commit: ghc] atomics: Update stg_casArrayzh to conform to new CMM conventions. (4b4c944)
git at git.haskell.org
git at git.haskell.org
Wed Aug 21 14:05:02 CEST 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : atomics
Link : http://ghc.haskell.org/trac/ghc/changeset/4b4c944b8b7b9f98a2bbd35c7b6811a9cdb847ee/ghc
>---------------------------------------------------------------
commit 4b4c944b8b7b9f98a2bbd35c7b6811a9cdb847ee
Author: Ryan Newton <rrnewton at gmail.com>
Date: Fri Aug 2 13:25:15 2013 -0400
Update stg_casArrayzh to conform to new CMM conventions.
>---------------------------------------------------------------
4b4c944b8b7b9f98a2bbd35c7b6811a9cdb847ee
rts/PrimOps.cmm | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index b13e05c..7103307 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -206,28 +206,25 @@ stg_unsafeThawArrayzh ( gcptr arr )
}
}
-stg_casArrayzh
+stg_casArrayzh ( gcptr arr, W_ ind, gcptr old, gcptr new )
/* MutableArray# s a -> Int# -> a -> a -> State# s -> (# State# s, Int#, a #) */
{
- W_ arr, p, ind, old, new, h, len;
- arr = R1; // anything else?
- ind = R2;
- old = R3;
- new = R4;
+ gcptr p, h;
+ W_ len;
p = arr + SIZEOF_StgMutArrPtrs + WDS(ind);
- (h) = foreign "C" cas(p, old, new) [];
+ (h) = ccall cas(p, old, new);
if (h != old) {
// Failure, return what was there instead of 'old':
- RET_NP(1,h);
+ return (1,h);
} else {
// Compare and Swap Succeeded:
SET_HDR(arr, stg_MUT_ARR_PTRS_DIRTY_info, CCCS);
len = StgMutArrPtrs_ptrs(arr);
// The write barrier. We must write a byte into the mark table:
I8[arr + SIZEOF_StgMutArrPtrs + WDS(len) + (ind >> MUT_ARR_PTRS_CARD_BITS )] = 1;
- RET_NP(0,h);
+ return (0,h);
}
}
More information about the ghc-commits
mailing list