diff options
author | Samuel Bronson <naesten@gmail.com> | 2009-01-27 08:48:25 +0000 |
---|---|---|
committer | Samuel Bronson <naesten@gmail.com> | 2009-01-27 08:48:25 +0000 |
commit | 979fb4abd736734d30089a8b328824d4a5862a6a (patch) | |
tree | f2d221d0726b4f4ba528d83965156473a49cddf5 /rts/PrimOps.cmm | |
parent | 9f35f6715879b9e81ffd538c3049e2dd243f807e (diff) | |
download | haskell-979fb4abd736734d30089a8b328824d4a5862a6a.tar.gz |
Implement #2191 (traceCcs# -- prints CCS of a value when available -- take 3)
In this version, I untag R1 before using it, and even enter R2 at the
end rather than simply returning it (which didn't work right when R2
was a thunk).
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r-- | rts/PrimOps.cmm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index dc60ff2457..a6e221bc5f 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -2362,6 +2362,26 @@ getApStackValzh_fast RET_NP(ok,val); } +/* ----------------------------------------------------------------------------- + Misc. primitives + -------------------------------------------------------------------------- */ + +// Write the cost center stack of the first argument on stderr; return +// the second. Possibly only makes sense for already evaluated +// things? +traceCcszh_fast +{ + W_ ccs; + +#ifdef PROFILING + ccs = StgHeader_ccs(UNTAG(R1)); + foreign "C" fprintCCS_stderr(ccs "ptr") [R2]; +#endif + + R1 = R2; + ENTER(); +} + getSparkzh_fast { W_ spark; |