summaryrefslogtreecommitdiff
path: root/rts/Printer.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-10-03 09:30:56 +0100
committerSimon Marlow <marlowsd@gmail.com>2012-10-08 09:04:40 +0100
commita7c0387d20c1c9994d1100b14fbb8fb4e28a259e (patch)
treeb95d0a512f951a4a463f1aa5178b0cd5c4fdb410 /rts/Printer.c
parentaed37acd4d157791381800d5de960a2461bcbef3 (diff)
downloadhaskell-a7c0387d20c1c9994d1100b14fbb8fb4e28a259e.tar.gz
Produce new-style Cmm from the Cmm parser
The main change here is that the Cmm parser now allows high-level cmm code with argument-passing and function calls. For example: foo ( gcptr a, bits32 b ) { if (b > 0) { // we can make tail calls passing arguments: jump stg_ap_0_fast(a); } return (x,y); } More details on the new cmm syntax are in Note [Syntax of .cmm files] in CmmParse.y. The old syntax is still more-or-less supported for those occasional code fragments that really need to explicitly manipulate the stack. However there are a couple of differences: it is now obligatory to give a list of live GlobalRegs on every jump, e.g. jump %ENTRY_CODE(Sp(0)) [R1]; Again, more details in Note [Syntax of .cmm files]. I have rewritten most of the .cmm files in the RTS into the new syntax, except for AutoApply.cmm which is generated by the genapply program: this file could be generated in the new syntax instead and would probably be better off for it, but I ran out of enthusiasm. Some other changes in this batch: - The PrimOp calling convention is gone, primops now use the ordinary NativeNodeCall convention. This means that primops and "foreign import prim" code must be written in high-level cmm, but they can now take more than 10 arguments. - CmmSink now does constant-folding (should fix #7219) - .cmm files now go through the cmmPipeline, and as a result we generate better code in many cases. All the object files generated for the RTS .cmm files are now smaller. Performance should be better too, but I haven't measured it yet. - RET_DYN frames are removed from the RTS, lots of code goes away - we now have some more canned GC points to cover unboxed-tuples with 2-4 pointers, which will reduce code size a little.
Diffstat (limited to 'rts/Printer.c')
-rw-r--r--rts/Printer.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/rts/Printer.c b/rts/Printer.c
index fb00401f59..4f9f83db52 100644
--- a/rts/Printer.c
+++ b/rts/Printer.c
@@ -251,7 +251,6 @@ printClosure( StgClosure *obj )
case RET_BCO:
case RET_SMALL:
case RET_BIG:
- case RET_DYN:
case RET_FUN:
*/
@@ -478,38 +477,7 @@ printStackChunk( StgPtr sp, StgPtr spBottom )
printObj((StgClosure*)sp);
continue;
- case RET_DYN:
- {
- StgRetDyn* r;
- StgPtr p;
- StgWord dyn;
- nat size;
-
- r = (StgRetDyn *)sp;
- dyn = r->liveness;
- debugBelch("RET_DYN (%p)\n", r);
-
- p = (P_)(r->payload);
- printSmallBitmap(spBottom, sp,
- RET_DYN_LIVENESS(r->liveness),
- RET_DYN_BITMAP_SIZE);
- p += RET_DYN_BITMAP_SIZE + RET_DYN_NONPTR_REGS_SIZE;
-
- for (size = RET_DYN_NONPTRS(dyn); size > 0; size--) {
- debugBelch(" stk[%ld] (%p) = ", (long)(spBottom-p), p);
- debugBelch("Word# %ld\n", (long)*p);
- p++;
- }
-
- for (size = RET_DYN_PTRS(dyn); size > 0; size--) {
- debugBelch(" stk[%ld] (%p) = ", (long)(spBottom-p), p);
- printPtr(p);
- p++;
- }
- continue;
- }
-
- case RET_SMALL:
+ case RET_SMALL:
debugBelch("RET_SMALL (%p)\n", info);
bitmap = info->layout.bitmap;
printSmallBitmap(spBottom, sp+1,
@@ -1112,7 +1080,6 @@ char *closure_type_names[] = {
[RET_BCO] = "RET_BCO",
[RET_SMALL] = "RET_SMALL",
[RET_BIG] = "RET_BIG",
- [RET_DYN] = "RET_DYN",
[RET_FUN] = "RET_FUN",
[UPDATE_FRAME] = "UPDATE_FRAME",
[CATCH_FRAME] = "CATCH_FRAME",