Rename atomicReadMVar and friends to readMVar.
authorEdward Z. Yang <ezyang@mit.edu>
Sat, 13 Jul 2013 01:12:25 +0000 (18:12 -0700)
committerEdward Z. Yang <ezyang@mit.edu>
Sat, 13 Jul 2013 01:12:25 +0000 (18:12 -0700)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
compiler/prelude/primops.txt.pp
includes/stg/MiscClosures.h
rts/HeapStackCheck.cmm
rts/Linker.c
rts/PrimOps.cmm

index 129d17b..f31a237 100644 (file)
@@ -1717,7 +1717,7 @@ primop  TryPutMVarOp "tryPutMVar#" GenPrimOp
    out_of_line      = True
    has_side_effects = True
 
-primop  AtomicReadMVarOp "atomicReadMVar#" GenPrimOp
+primop  ReadMVarOp "readMVar#" GenPrimOp
    MVar# s a -> State# s -> (# State# s, a #)
    {If {\tt MVar\#} is empty, block until it becomes full.
    Then read its contents without modifying the MVar, without possibility
@@ -1726,7 +1726,7 @@ primop  AtomicReadMVarOp "atomicReadMVar#" GenPrimOp
    out_of_line      = True
    has_side_effects = True
 
-primop  TryAtomicReadMVarOp "tryAtomicReadMVar#" GenPrimOp
+primop  TryReadMVarOp "tryReadMVar#" GenPrimOp
    MVar# s a -> State# s -> (# State# s, Int#, a #)
    {If {\tt MVar\#} is empty, immediately return with integer 0 and value undefined.
    Otherwise, return with integer 1 and contents of {\tt MVar\#}.}
index 287fce9..b0ed03b 100644 (file)
@@ -293,9 +293,9 @@ RTS_FUN_DECL(stg_block_noregs);
 RTS_FUN_DECL(stg_block_blackhole);
 RTS_FUN_DECL(stg_block_blackhole_finally);
 RTS_FUN_DECL(stg_block_takemvar);
-RTS_FUN_DECL(stg_block_atomicreadmvar);
+RTS_FUN_DECL(stg_block_readmvar);
 RTS_RET(stg_block_takemvar);
-RTS_RET(stg_block_atomicreadmvar);
+RTS_RET(stg_block_readmvar);
 RTS_FUN_DECL(stg_block_putmvar);
 RTS_RET(stg_block_putmvar);
 #ifdef mingw32_HOST_OS
@@ -378,10 +378,10 @@ RTS_FUN_DECL(stg_isEmptyMVarzh);
 RTS_FUN_DECL(stg_newMVarzh);
 RTS_FUN_DECL(stg_takeMVarzh);
 RTS_FUN_DECL(stg_putMVarzh);
-RTS_FUN_DECL(stg_atomicReadMVarzh);
+RTS_FUN_DECL(stg_readMVarzh);
 RTS_FUN_DECL(stg_tryTakeMVarzh);
 RTS_FUN_DECL(stg_tryPutMVarzh);
-RTS_FUN_DECL(stg_tryAtomicReadMVarzh);
+RTS_FUN_DECL(stg_tryReadMVarzh);
 
 RTS_FUN_DECL(stg_waitReadzh);
 RTS_FUN_DECL(stg_waitWritezh);
index 20cd9df..e130cb3 100644 (file)
@@ -487,7 +487,7 @@ stg_block_noregs
 /* -----------------------------------------------------------------------------
  * takeMVar/putMVar-specific blocks
  *
- * Stack layout for a thread blocked in takeMVar/atomicReadMVar:
+ * Stack layout for a thread blocked in takeMVar/readMVar:
  *      
  *       ret. addr
  *       ptr to MVar   (R1)
@@ -531,14 +531,14 @@ stg_block_takemvar /* mvar passed in R1 */
     BLOCK_BUT_FIRST(stg_block_takemvar_finally);
 }
 
-INFO_TABLE_RET ( stg_block_atomicreadmvar, RET_SMALL, W_ info_ptr, P_ mvar )
+INFO_TABLE_RET ( stg_block_readmvar, RET_SMALL, W_ info_ptr, P_ mvar )
     return ()
 {
-    jump stg_atomicReadMVarzh(mvar);
+    jump stg_readMVarzh(mvar);
 }
 
 // code fragment executed just before we return to the scheduler
-stg_block_atomicreadmvar_finally
+stg_block_readmvar_finally
 {
     W_ r1, r3;
     r1 = R1;
@@ -549,13 +549,13 @@ stg_block_atomicreadmvar_finally
     jump StgReturn [R1];
 }
 
-stg_block_atomicreadmvar /* mvar passed in R1 */
+stg_block_readmvar /* mvar passed in R1 */
 {
     Sp_adj(-2);
     Sp(1) = R1;
-    Sp(0) = stg_block_atomicreadmvar_info;
-    R3 = R1; // mvar communicated to stg_block_atomicreadmvar_finally in R3
-    BLOCK_BUT_FIRST(stg_block_atomicreadmvar_finally);
+    Sp(0) = stg_block_readmvar_info;
+    R3 = R1; // mvar communicated to stg_block_readmvar_finally in R3
+    BLOCK_BUT_FIRST(stg_block_readmvar_finally);
 }
 
 INFO_TABLE_RET( stg_block_putmvar, RET_SMALL, W_ info_ptr,
index 1389b4f..08069cf 100644 (file)
@@ -1058,7 +1058,7 @@ typedef struct _RtsSymbolVal {
       SymI_HasProto(stg_yield_to_interpreter)                           \
       SymI_HasProto(stg_block_noregs)                                   \
       SymI_HasProto(stg_block_takemvar)                                 \
-      SymI_HasProto(stg_block_atomicreadmvar)                           \
+      SymI_HasProto(stg_block_readmvar)                           \
       SymI_HasProto(stg_block_putmvar)                                  \
       MAIN_CAP_SYM                                                      \
       SymI_HasProto(MallocFailHook)                                     \
@@ -1315,11 +1315,11 @@ typedef struct _RtsSymbolVal {
       SymI_HasProto(stg_bh_upd_frame_info)                              \
       SymI_HasProto(suspendThread)                                      \
       SymI_HasProto(stg_takeMVarzh)                                     \
-      SymI_HasProto(stg_atomicReadMVarzh)                               \
+      SymI_HasProto(stg_readMVarzh)                               \
       SymI_HasProto(stg_threadStatuszh)                                 \
       SymI_HasProto(stg_tryPutMVarzh)                                   \
       SymI_HasProto(stg_tryTakeMVarzh)                                  \
-      SymI_HasProto(stg_tryAtomicReadMVarzh)                            \
+      SymI_HasProto(stg_tryReadMVarzh)                            \
       SymI_HasProto(stg_unmaskAsyncExceptionszh)                        \
       SymI_HasProto(unloadObj)                                          \
       SymI_HasProto(stg_unsafeThawArrayzh)                              \
index 6bb938e..648594b 100644 (file)
@@ -1406,7 +1406,7 @@ loop:
         goto loop;
     }
 
-    // There are atomicReadMVar/takeMVar(s) waiting: wake up the first one
+    // There are readMVar/takeMVar(s) waiting: wake up the first one
 
     tso = StgMVarTSOQueue_tso(q);
     StgMVar_head(mvar) = StgMVarTSOQueue_link(q);
@@ -1434,7 +1434,7 @@ loop:
 
     ccall tryWakeupThread(MyCapability() "ptr", tso);
 
-    // If it was an atomicReadMVar, then we can still do work,
+    // If it was an readMVar, then we can still do work,
     // so loop back. (XXX: This could take a while)
     if (why_blocked == BlockedOnMVarRead) {
         q = StgMVarTSOQueue_link(q);
@@ -1508,7 +1508,7 @@ loop:
 
     ccall tryWakeupThread(MyCapability() "ptr", tso);
 
-    // If it was an atomicReadMVar, then we can still do work,
+    // If it was an readMVar, then we can still do work,
     // so loop back. (XXX: This could take a while)
     if (why_blocked == BlockedOnMVarRead) {
         q = StgMVarTSOQueue_link(q);
@@ -1521,7 +1521,7 @@ loop:
     return (1);
 }
 
-stg_atomicReadMVarzh ( P_ mvar, /* :: MVar a */ )
+stg_readMVarzh ( P_ mvar, /* :: MVar a */ )
 {
     W_ val, info, tso, q;
 
@@ -1539,7 +1539,7 @@ stg_atomicReadMVarzh ( P_ mvar, /* :: MVar a */ )
         ALLOC_PRIM_WITH_CUSTOM_FAILURE
             (SIZEOF_StgMVarTSOQueue,
              unlockClosure(mvar, stg_MVAR_DIRTY_info);
-             GC_PRIM_P(stg_atomicReadMVarzh, mvar));
+             GC_PRIM_P(stg_readMVarzh, mvar));
 
         q = Hp - SIZEOF_StgMVarTSOQueue + WDS(1);
 
@@ -1558,7 +1558,7 @@ stg_atomicReadMVarzh ( P_ mvar, /* :: MVar a */ )
             StgMVar_tail(mvar) = q;
         }
 
-        jump stg_block_atomicreadmvar(mvar);
+        jump stg_block_readmvar(mvar);
     }
 
     val = StgMVar_value(mvar);
@@ -1567,7 +1567,7 @@ stg_atomicReadMVarzh ( P_ mvar, /* :: MVar a */ )
     return (val);
 }
 
-stg_tryAtomicReadMVarzh ( P_ mvar, /* :: MVar a */ )
+stg_tryReadMVarzh ( P_ mvar, /* :: MVar a */ )
 {
     W_ val, info, tso, q;