projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
613c5f6
)
add readTVarIO :: TVar a -> IO a
author
Simon Marlow
<marlowsd@gmail.com>
Fri, 10 Oct 2008 13:15:45 +0000
(13:15 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Fri, 10 Oct 2008 13:15:45 +0000
(13:15 +0000)
compiler/prelude/primops.txt.pp
patch
|
blob
|
history
includes/StgMiscClosures.h
patch
|
blob
|
history
includes/mkDerivedConstants.c
patch
|
blob
|
history
rts/Linker.c
patch
|
blob
|
history
rts/PrimOps.cmm
patch
|
blob
|
history
diff --git
a/compiler/prelude/primops.txt.pp
b/compiler/prelude/primops.txt.pp
index
39ae85d
..
417d42e
100644
(file)
--- a/
compiler/prelude/primops.txt.pp
+++ b/
compiler/prelude/primops.txt.pp
@@
-1340,6
+1340,13
@@
primop ReadTVarOp "readTVar#" GenPrimOp
with
out_of_line = True
with
out_of_line = True
+primop ReadTVarIOOp "readTVarIO#" GenPrimOp
+ TVar# s a
+ -> State# s -> (# State# s, a #)
+ {Read contents of {\tt TVar\#} outside an STM transaction}
+ with
+ out_of_line = True
+
primop WriteTVarOp "writeTVar#" GenPrimOp
TVar# s a
-> a
primop WriteTVarOp "writeTVar#" GenPrimOp
TVar# s a
-> a
diff --git
a/includes/StgMiscClosures.h
b/includes/StgMiscClosures.h
index
16cd476
..
f69a4ae
100644
(file)
--- a/
includes/StgMiscClosures.h
+++ b/
includes/StgMiscClosures.h
@@
-600,6
+600,7
@@
RTS_FUN(catchSTMzh_fast);
RTS_FUN(atomicallyzh_fast);
RTS_FUN(newTVarzh_fast);
RTS_FUN(readTVarzh_fast);
RTS_FUN(atomicallyzh_fast);
RTS_FUN(newTVarzh_fast);
RTS_FUN(readTVarzh_fast);
+RTS_FUN(readTVarIOzh_fast);
RTS_FUN(writeTVarzh_fast);
RTS_FUN(checkzh_fast);
RTS_FUN(writeTVarzh_fast);
RTS_FUN(checkzh_fast);
diff --git
a/includes/mkDerivedConstants.c
b/includes/mkDerivedConstants.c
index
aaa4531
..
3aa7625
100644
(file)
--- a/
includes/mkDerivedConstants.c
+++ b/
includes/mkDerivedConstants.c
@@
-353,6
+353,8
@@
main(int argc, char *argv[])
closure_field(StgTVarWatchQueue, next_queue_entry);
closure_field(StgTVarWatchQueue, prev_queue_entry);
closure_field(StgTVarWatchQueue, next_queue_entry);
closure_field(StgTVarWatchQueue, prev_queue_entry);
+ closure_field(StgTVar, current_value);
+
closure_size(StgWeak);
closure_field(StgWeak,link);
closure_field(StgWeak,key);
closure_size(StgWeak);
closure_field(StgWeak,link);
closure_field(StgWeak,key);
diff --git
a/rts/Linker.c
b/rts/Linker.c
index
69b21a2
..
0b556b7
100644
(file)
--- a/
rts/Linker.c
+++ b/
rts/Linker.c
@@
-643,6
+643,7
@@
typedef struct _RtsSymbolVal {
SymX(raisezh_fast) \
SymX(raiseIOzh_fast) \
SymX(readTVarzh_fast) \
SymX(raisezh_fast) \
SymX(raiseIOzh_fast) \
SymX(readTVarzh_fast) \
+ SymX(readTVarIOzh_fast) \
SymX(remIntegerzh_fast) \
SymX(resetNonBlockingFd) \
SymX(resumeThread) \
SymX(remIntegerzh_fast) \
SymX(resetNonBlockingFd) \
SymX(resumeThread) \
diff --git
a/rts/PrimOps.cmm
b/rts/PrimOps.cmm
index
c666a42
..
e65cbc4
100644
(file)
--- a/
rts/PrimOps.cmm
+++ b/
rts/PrimOps.cmm
@@
-1455,6
+1455,17
@@
readTVarzh_fast
RET_P(result);
}
RET_P(result);
}
+readTVarIOzh_fast
+{
+ W_ result;
+
+again:
+ result = StgTVar_current_value(R1);
+ if (%INFO_PTR(result) == stg_TREC_HEADER_info) {
+ goto again;
+ }
+ RET_P(result);
+}
writeTVarzh_fast
{
writeTVarzh_fast
{