ENTER(): avoid re-reading the info pointer of the closure when entering it
authorSimon Marlow <simonmar@microsoft.com>
Tue, 14 Mar 2006 11:41:53 +0000 (11:41 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Tue, 14 Mar 2006 11:41:53 +0000 (11:41 +0000)
This fixes another instance of a subtle SMP bug (see patch "really
nasty bug in SMP").

ghc/includes/Cmm.h

index ea760a8..783b0e4 100644 (file)
 
 #define ENTER()                                                \
  again:                                                        \
+  W_ info;                                             \
+  info = %INFO_PTR(R1);                                        \
   switch [INVALID_OBJECT .. N_CLOSURE_TYPES]           \
-         (TO_W_( %INFO_TYPE(%GET_STD_INFO(R1)) )) {    \
-  case                                                         \
+         (TO_W_( %INFO_TYPE(%STD_INFO(info)) )) {      \
+  case                                                 \
     IND,                                               \
     IND_OLDGEN,                                                \
     IND_PERM,                                          \
       R1 = StgInd_indirectee(R1);                      \
       goto again;                                      \
    }                                                   \
-  case                                                         \
+  case                                                 \
     BCO,                                               \
     FUN,                                               \
     FUN_1_0,                                           \
    }                                                   \
   default:                                             \
    {                                                   \
-      jump %GET_ENTRY(R1);                             \
+      jump %ENTRY_CODE(info);                          \
    }                                                   \
   }