[project @ 2000-07-14 13:28:35 by simonmar]
[ghc-hetmet.git] / ghc / rts / Disassembler.c
index cbf36ac..cd8ea43 100644 (file)
@@ -5,8 +5,8 @@
  * Copyright (c) 1994-1998.
  *
  * $RCSfile: Disassembler.c,v $
- * $Revision: 1.9 $
- * $Date: 1999/10/26 17:27:31 $
+ * $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;
@@ -97,6 +109,17 @@ static InstrPtr disInfo   ( StgBCO *bco, InstrPtr pc, char* i )
     return pc;
 }
 
+static InstrPtr disInfo16 ( StgBCO *bco, InstrPtr pc, char* i )
+{
+    StgWord x = bcoInstr16(bco,pc); 
+    StgInfoTable* info = bcoConstInfoPtr(bco,x);
+    pc+=2;
+    /* ToDo: print contents of infotable */
+    fprintf(stderr,"%s ",i);
+    printPtr(stgCast(StgPtr,info));
+    return pc;
+}
+
 static InstrPtr disConstPtr  ( StgBCO *bco, InstrPtr pc, char* i )
 {
     StgInt o = bcoInstr(bco,pc++);
@@ -205,6 +228,8 @@ InstrPtr disInstr( StgBCO *bco, InstrPtr pc )
             return disNone(bco,pc,"PANIC");
     case i_STK_CHECK:
             return disInt(bco,pc,"STK_CHECK");
+    case i_STK_CHECK_big:
+            return disInt16(bco,pc,"STK_CHECK_big");
     case i_ARG_CHECK:
             return disInt(bco,pc,"ARG_CHECK");
     case i_ALLOC_AP:
@@ -213,6 +238,8 @@ InstrPtr disInstr( StgBCO *bco, InstrPtr pc )
             return disInt(bco,pc,"ALLOC_PAP");
     case i_ALLOC_CONSTR:
             return disInfo(bco,pc,"ALLOC_CONSTR");
+    case i_ALLOC_CONSTR_big:
+            return disInfo16(bco,pc,"ALLOC_CONSTR_big");
     case i_MKAP:
             return disIntInt(bco,pc,"MKAP");
     case i_MKAP_big:
@@ -252,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");
 
@@ -379,6 +436,8 @@ InstrPtr disInstr( StgBCO *bco, InstrPtr pc )
                     return disNone(bco,pc,"ccall_stdcall_IO");
             case i_raise:
                     return disNone(bco,pc,"primRaise");
+            case i_takeMVar:
+                    return disNone(bco,pc,"primTakeMVar");
             default:
                 {
                     const AsmPrim* p = asmFindPrimop(i_PRIMOP2,op);