Commit 4b4c944b authored by rrnewton's avatar rrnewton

Update stg_casArrayzh to conform to new CMM conventions.

parent 1c45d05d
......@@ -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);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment