[project @ 1999-08-25 16:11:43 by simonmar]
[ghc-hetmet.git] / ghc / rts / Evaluator.c
index 575a028..f7c8147 100644 (file)
@@ -5,8 +5,8 @@
  * Copyright (c) 1994-1998.
  *
  * $RCSfile: Evaluator.c,v $
- * $Revision: 1.15 $
- * $Date: 1999/04/28 12:59:51 $
+ * $Revision: 1.17 $
+ * $Date: 1999/07/06 16:40:24 $
  * ---------------------------------------------------------------------------*/
 
 #include "Rts.h"
@@ -473,7 +473,11 @@ StgThreadReturnCode enter( StgClosure* obj0 )
             );
 #endif
 
-    if (++eCount == 0) {
+    if (
+#ifdef DEBUG
+        1 ||
+#endif
+             ++eCount == 0) {
        if (context_switch) {
           xPushCPtr(obj); /* code to restart with */
           RETURN(ThreadYielding);
@@ -532,7 +536,7 @@ StgThreadReturnCode enter( StgClosure* obj0 )
             fprintf(stderr,"Sp = %p\tSu = %p\tpc = %d\t", xSp, xSu, PC);
                     SSS;
                     disInstr(bco,PC);
-                    { int i;
+                    if (0) { int i;
                     fprintf(stderr,"\n");
                       for (i = 8; i >= 0; i--) 
                          fprintf(stderr, "%d  %p\n", i, (StgPtr)(*(Sp+i)));
@@ -813,6 +817,11 @@ StgThreadReturnCode enter( StgClosure* obj0 )
                     ASSERT(  itbl->type == CONSTR
                           || itbl->type == CONSTR_STATIC
                           || itbl->type == CONSTR_NOCAF_STATIC
+                          || itbl->type == CONSTR_1_0
+                          || itbl->type == CONSTR_0_1
+                          || itbl->type == CONSTR_2_0
+                          || itbl->type == CONSTR_1_1
+                          || itbl->type == CONSTR_0_2
                           );
                     while (--i>=0) {
                         xPushCPtr(payloadCPtr(o,i));
@@ -1276,7 +1285,9 @@ StgThreadReturnCode enter( StgClosure* obj0 )
             goto enterLoop;
         }
     case BLACKHOLE:
+    case SE_BLACKHOLE:
     case CAF_BLACKHOLE:
+    case SE_CAF_BLACKHOLE:
         {
            /*was StgBlackHole* */
             StgBlockingQueue* bh = (StgBlockingQueue*)obj;
@@ -1303,8 +1314,7 @@ StgThreadReturnCode enter( StgClosure* obj0 )
                 xPushWord(payloadWord(ap,i));
             }
             obj = ap->fun;
-#ifndef LAZY_BLACKHOLING
-#error no no no
+#ifdef EAGER_BLACKHOLING
             {
                 /* superfluous - but makes debugging easier */
                 StgBlackHole* bh = stgCast(StgBlackHole*,ap);
@@ -1313,7 +1323,7 @@ StgThreadReturnCode enter( StgClosure* obj0 )
                 IF_DEBUG(gccafs,fprintf(stderr,"Eagerly blackholed AP_UPD %p in evaluator\n",bh));
                 /*printObj(bh); */
             }
-#endif /* LAZY_BLACKHOLING */
+#endif /* EAGER_BLACKHOLING */
             goto enterLoop;
         }
     case PAP:
@@ -1340,6 +1350,11 @@ StgThreadReturnCode enter( StgClosure* obj0 )
             goto enterLoop;
         }
     case CONSTR:
+    case CONSTR_1_0:
+    case CONSTR_0_1:
+    case CONSTR_2_0:
+    case CONSTR_1_1:
+    case CONSTR_0_2:
     case CONSTR_INTLIKE:
     case CONSTR_CHARLIKE:
     case CONSTR_STATIC:
@@ -1399,15 +1414,11 @@ StgThreadReturnCode enter( StgClosure* obj0 )
         }
     default:
         {
-            SSS;
-            fprintf(stderr, "enterCountI = %d\n", enterCountI);
-            fprintf(stderr, "panic: enter: entered unknown closure\n"); 
-            printObj(obj);
-            fprintf(stderr, "what it points at is\n");
-            printObj( ((StgEvacuated*)obj) ->evacuee);
-            LLL;
-            exit(1);
-            /* formerly ... */
+            //SSS;
+            //fprintf(stderr, "enterCountI = %d\n", enterCountI);
+            //fprintf(stderr, "entering unknown closure -- yielding to sched\n"); 
+            //printObj(obj);
+            //LLL;
             CurrentTSO->whatNext = ThreadEnterGHC;
             xPushCPtr(obj); /* code to restart with */
             RETURN(ThreadYielding);
@@ -1604,11 +1615,13 @@ static inline void PopUpdateFrame( StgClosure* obj )
              printObj(obj);
              fprintf(stderr,"Sp = %p\tSu = %p\n\n", Sp, Su);
              );
-#ifndef LAZY_BLACKHOLING
+#ifdef EAGER_BLACKHOLING
     ASSERT(get_itbl(Su->updatee)->type == BLACKHOLE
+           || get_itbl(Su->updatee)->type == SE_BLACKHOLE
            || get_itbl(Su->updatee)->type == CAF_BLACKHOLE
+           || get_itbl(Su->updatee)->type == SE_CAF_BLACKHOLE
            );
-#endif /* LAZY_BLACKHOLING */
+#endif /* EAGER_BLACKHOLING */
     UPD_IND(Su->updatee,obj);
     Sp = stgCast(StgStackPtr,Su) + sizeofW(StgUpdateFrame);
     Su = Su->link;