summaryrefslogtreecommitdiff
path: root/ghc/rts/Disassembler.c
diff options
context:
space:
mode:
authordaan <unknown>2000-06-15 13:23:52 +0000
committerdaan <unknown>2000-06-15 13:23:52 +0000
commit3d124552f679101c2f6dd98101b10dbcf9ba0898 (patch)
tree9c88cd95dffb9513cb0563d3947f405a30b2a1c8 /ghc/rts/Disassembler.c
parentb619d74d6d72f0ee748ae3f198a76db58e0272bd (diff)
downloadhaskell-3d124552f679101c2f6dd98101b10dbcf9ba0898.tar.gz
[project @ 2000-06-15 13:23:51 by daan]
Added new primitives and bytecodes that support code generation for XMLambda. All additions are surrounded by #ifdef XMLAMBDA. Most important additions: - Rows (n-tuples) which are implemented on top of Frozen Mutarrays - Inj (variant sums), which is implemented using a new constructor called Inj which contains both the value and an unboxed int which represents the index.
Diffstat (limited to 'ghc/rts/Disassembler.c')
-rw-r--r--ghc/rts/Disassembler.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/ghc/rts/Disassembler.c b/ghc/rts/Disassembler.c
index 56792cb34e..cd8ea439ee 100644
--- a/ghc/rts/Disassembler.c
+++ b/ghc/rts/Disassembler.c
@@ -5,8 +5,8 @@
* Copyright (c) 1994-1998.
*
* $RCSfile: Disassembler.c,v $
- * $Revision: 1.12 $
- * $Date: 1999/12/07 11:49:11 $
+ * $Revision: 1.13 $
+ * $Date: 2000/06/15 13:23:51 $
* ---------------------------------------------------------------------------*/
#include "Rts.h"
@@ -81,6 +81,18 @@ static InstrPtr disIntPC ( StgBCO *bco, InstrPtr pc, char* i )
return pc;
}
+#ifdef XMLAMBDA
+static InstrPtr disInt16PC ( StgBCO *bco, InstrPtr pc, char* i )
+{
+ StgInt x;
+ StgWord y;
+ x = bcoInstr(bco,pc); pc += 2;
+ y = bcoInstr16(bco,pc); pc += 2;
+ fprintf(stderr,"%s %d %d",i,x,pc+y);
+ return pc;
+}
+#endif
+
static InstrPtr disPC ( StgBCO *bco, InstrPtr pc, char* i )
{
StgWord y = bcoInstr16(bco,pc); pc += 2;
@@ -267,6 +279,36 @@ InstrPtr disInstr( StgBCO *bco, InstrPtr pc )
case i_CONST_big:
return disConstPtr16(bco,pc,"CONST_big");
+#ifdef XMLAMBDA
+ case i_ALLOC_ROW:
+ return disInt(bco,pc,"ALLOC_ROW");
+ case i_ALLOC_ROW_big:
+ return disInt16(bco,pc,"ALLOC_ROW_big");
+ case i_PACK_ROW:
+ return disInt(bco,pc,"PACK_ROW");
+ case i_PACK_ROW_big:
+ return disInt16(bco,pc,"PACK_ROW_big");
+
+ case i_PACK_INJ:
+ return disInt(bco,pc,"PACK_INJ");
+ case i_PACK_INJ_big:
+ return disInt16(bco,pc,"PACK_INJ_big");
+ case i_PACK_INJ_CONST:
+ return disInt(bco,pc,"PACK_INJ_CONST");
+
+ case i_UNPACK_ROW:
+ return disNone(bco,pc,"UNPACK_ROW");
+ case i_UNPACK_INJ:
+ return disNone(bco,pc,"UNPACK_INJ");
+
+ case i_TEST_INJ:
+ return disIntPC(bco,pc,"TEST_INJ");
+ case i_TEST_INJ_big:
+ return disInt16PC(bco,pc,"TEST_INJ_big");
+ case i_TEST_INJ_CONST:
+ return disIntPC(bco,pc,"TEST_INJ_CONST");
+#endif
+
case i_VOID:
return disNone(bco,pc,"VOID");