[project @ 1999-11-29 18:59:23 by sewardj]
[ghc-hetmet.git] / ghc / rts / Updates.hc
index aad6dc1..c10b822 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Updates.hc,v 1.19 1999/09/14 12:16:36 simonmar Exp $
+ * $Id: Updates.hc,v 1.23 1999/11/29 12:02:46 keithw Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
    update code. 
    */
 
+#if defined(REG_Su)
+#define UPD_FRAME_ENTRY_TEMPLATE(label,ret)                            \
+        STGFUN(label);                                                 \
+       STGFUN(label)                                                   \
+       {                                                               \
+         FB_                                                           \
+                                                                       \
+          Su = (StgUpdateFrame *)((StgUpdateFrame *)Sp)->updatee;      \
+                                                                       \
+         /* Tick - it must be a con, all the paps are handled          \
+          * in stg_upd_PAP and PAP_entry below                         \
+          */                                                           \
+         TICK_UPD_CON_IN_NEW(sizeW_fromITBL(get_itbl(Su)));            \
+                                                                       \
+         UPD_IND(Su,R1.p);                                             \
+                                                                       \
+         /* reset Su to the next update frame */                       \
+         Su = ((StgUpdateFrame *)Sp)->link;                            \
+                                                                       \
+         /* remove the update frame from the stack */                  \
+         Sp += sizeofW(StgUpdateFrame);                                \
+                                                                       \
+         JMP_(ret);                                                    \
+         FE_                                                           \
+       }
+#else
+
 #define UPD_FRAME_ENTRY_TEMPLATE(label,ret)                            \
         STGFUN(label);                                                 \
        STGFUN(label)                                                   \
@@ -60,8 +87,7 @@
           */                                                           \
          TICK_UPD_CON_IN_NEW(sizeW_fromITBL(get_itbl(updatee)));       \
                                                                        \
-         /* update the updatee with an indirection to the return value */\
-         UPD_IND(updatee,R1.p);                                        \
+         UPD_IND(updatee, R1.cl);                                      \
                                                                        \
          /* reset Su to the next update frame */                       \
          Su = ((StgUpdateFrame *)Sp)->link;                            \
@@ -72,6 +98,7 @@
          JMP_(ret);                                                    \
          FE_                                                           \
        }
+#endif
 
 UPD_FRAME_ENTRY_TEMPLATE(Upd_frame_entry,ENTRY_CODE(Sp[0]));
 UPD_FRAME_ENTRY_TEMPLATE(Upd_frame_0_entry,RET_VEC(Sp[0],0));
@@ -598,6 +625,19 @@ FN_(raisezh_fast)
   FB_
     /* args : R1 = error */
 
+#if defined(PROFILING)
+
+    /* Debugging tool: on raising an  exception, show where we are. */
+
+    /* ToDo: currently this is a hack.  Would be much better if
+     * the info was only displayed for an *uncaught* exception.
+     */
+    if (RtsFlags.ProfFlags.showCCSOnException) {
+      STGCALL2(print_ccs,stderr,CCCS);
+    }
+
+#endif
+
     p = Su;
 
     /* This closure represents the expression 'raise# E' where E