\begin{code}
#define ARGS_CHK_A(n) \
- SET_ACTIVITY(ACT_ARGS_CHK); /* SPAT counting */ \
if (SuA /*SUBTRACT_A_STK( SpA, SuA )*/ < (SpA+(n))) { \
JMP_( UpdatePAP ); \
- } \
- SET_ACTIVITY(ACT_TAILCALL)
+ }
#define ARGS_CHK_A_LOAD_NODE(n, closure_addr) \
- SET_ACTIVITY(ACT_ARGS_CHK); /* SPAT counting */ \
if (SuA /*SUBTRACT_A_STK( SpA, SuA )*/ < (SpA+(n))) { \
Node = (P_) closure_addr; \
JMP_( UpdatePAP ); \
- } \
- SET_ACTIVITY(ACT_TAILCALL)
-
+ }
#define ARGS_CHK_B(n) \
- SET_ACTIVITY(ACT_ARGS_CHK); /* SPAT counting */ \
if (SpB /*SUBTRACT_B_STK( SpB, SuB )*/ < (SuB-(n))) { \
JMP_( UpdatePAP ); \
- } \
- SET_ACTIVITY(ACT_TAILCALL)
+ }
#define ARGS_CHK_B_LOAD_NODE(n, closure_addr) \
- SET_ACTIVITY(ACT_ARGS_CHK); /* SPAT counting */ \
if (SpB /*SUBTRACT_B_STK( SpB, SuB )*/ < (SuB-(n))) { \
Node = (P_) closure_addr; \
JMP_( UpdatePAP ); \
- } \
- SET_ACTIVITY(ACT_TAILCALL)
-
+ }
\end{code}
%************************************************************************
NB: args @a@ and @b@ are pre-direction-ified!
\begin{code}
extern I_ SqueezeUpdateFrames PROTO((P_, P_, P_));
+int sanityChk_StkO (P_ stko); /* ToDo: move to a sane place */
#if ! defined(CONCURRENT)
do { \
DO_ASTK_HWM(); /* ticky-ticky profiling */ \
DO_BSTK_HWM(); \
- /* SET_ACTIVITY(ACT_STK_CHK); /? SPAT counting -- no, using page faulting */ \
if (STKS_OVERFLOW_OP((a_headroom) + 1, (b_headroom) + 1)) { \
STACK_OVERFLOW(liveness_mask,a_headroom,b_headroom,spa,spb,ret_type,reenter);\
} \
#define HEAP_OVERFLOW(liveness,n,reenter) \
do { \
- SET_ACTIVITY(ACT_GC); /* SPAT profiling */ \
DO_GC((((W_)n)<<8)|(liveness)); \
- SET_ACTIVITY(ACT_GC_STOP); \
} while (0)
#define REQSIZE_BITMASK ((1L << ((BITS_IN(W_) - 8 + 1))) - 1)
#define HEAP_OVERFLOW(liveness,n,reenter) \
do { \
- SET_ACTIVITY(ACT_GC); /* SPAT profiling */ \
DO_GC((((W_)(n))<<9)|((reenter)<<8)|(liveness)); \
- SET_ACTIVITY(ACT_GC_STOP); \
} while (0)
#define REQSIZE_BITMASK ((1L << ((BITS_IN(W_) - 9 + 1))) - 1)
/* THREAD_CONTEXT_SWITCH(liveness_mask,reenter); */ \
ALLOC_HEAP(n); /* ticky profiling */ \
GRAN_ALLOC_HEAP(n,liveness_mask); /* Granularity Simulation */ \
- SET_ACTIVITY(ACT_HEAP_CHK); /* SPAT counting */ \
if (((Hp = Hp + (n)) > HpLim)) { \
/* Old: STGCALL3_GC(PerformGC,liveness_mask,n,StgFalse); */\
HEAP_OVERFLOW(liveness_mask,n,StgFalse); \
- } \
- SET_ACTIVITY(ACT_REDN); /* back to normal reduction */ \
- }while(0)
+ }}while(0)
#else
/* TICKY_PARANOIA(__FILE__, __LINE__); */ \
PRE_FETCH(n); \
ALLOC_HEAP(n); /* ticky profiling */ \
- SET_ACTIVITY(ACT_HEAP_CHK); /* SPAT counting */ \
if (((Hp = Hp + (n)) > HpLim) OR_INTERVAL_EXPIRED OR_CONTEXT_SWITCH OR_MSG_PENDING) { \
HEAP_OVERFLOW(liveness_mask,n,reenter); \
} \
/* TICKY_PARANOIA(__FILE__, __LINE__); */ \
PRE_FETCH(n); \
ALLOC_HEAP(n); /* ticky profiling */ \
- SET_ACTIVITY(ACT_HEAP_CHK); /* SPAT counting */ \
if (((Hp = Hp + (n)) > HpLim) OR_INTERVAL_EXPIRED OR_CONTEXT_SWITCH OR_MSG_PENDING) { \
HEAP_OVERFLOW(liveness_mask,n,reenter); \
n = TSO_ARG1(CurrentTSO); \
- } \
- SET_ACTIVITY(ACT_REDN); /* back to normal reduction */\
-} while(0)
+ }} while(0)
#else
UN_ALLOC_HEAP(n); /* Undo ticky-ticky */ \
SAVE_Hp = Hp; /* Hand over the hp */ \
DEBUG_SetGMPAllocBudget(n) \
- OptSaveHpLimRegister() \
}while(0)
#define GMP_HEAP_HANDBACK() \
Hp = SAVE_Hp; \
- DEBUG_ResetGMPAllocBudget() \
- OptRestoreHpLimRegister()
+ DEBUG_ResetGMPAllocBudget()
\end{code}
\begin{code}
#endif
\end{code}
-\begin{code}
-#if defined (LIFE_PROFILE)
-
-#define OptSaveHpLimRegister() \
- SAVE_HpLim = HpLim
-#define OptRestoreHpLimRegister() \
- HpLim = SAVE_HpLim
-
-#else /* ! LIFE_PROFILE */
-
-#define OptSaveHpLimRegister() /* nothing */
-#define OptRestoreHpLimRegister() /* nothing */
-
-#endif /* ! LIFE_PROFILE */
-\end{code}
-
The real business (defining Integer primops):
\begin{code}
#define negateIntegerZh(ar,sr,dr, liveness, aa,sa,da) \
|| alpha_TARGET_ARCH \
|| hppa1_1_TARGET_ARCH \
|| i386_TARGET_ARCH \
- || i486_TARGET_ARCH \
|| m68k_TARGET_ARCH \
|| mipsel_TARGET_ARCH \
|| mipseb_TARGET_ARCH \
- || rs6000_TARGET_ARCH
+ || powerpc_TARGET_ARCH
/* yes, it is IEEE floating point */
#include "ieee-flpt.h"
#if alpha_dec_osf1_TARGET \
|| i386_TARGET_ARCH \
- || i486_TARGET_ARCH \
|| mipsel_TARGET_ARCH
#undef BIGENDIAN /* little-endian weirdos... */
\begin{code}
#if alpha_TARGET_ARCH \
|| i386_TARGET_ARCH \
- || i486_TARGET_ARCH \
|| m68k_TARGET_ARCH
#define ASSIGN_FLT(dst, src) *(StgFloat *)(dst) = (src);
OK, the easy ops first: (all except \tr{newArr*}:
-VERY IMPORTANT! The read/write/index primitive ops
+(OLD:) VERY IMPORTANT! The read/write/index primitive ops
on @ByteArray#@s index the array using a {\em BYTE} offset, even
if the thing begin gotten out is a multi-byte @Int#@, @Float#@ etc.
This is because you might be trying to take apart a C struct, where
the offset from the start of the struct isn't a multiple of the
size of the thing you're getting. Hence the @(char *)@ casts.
+EVEN MORE IMPORTANT! The above is a lie. The offsets for BlahArrays
+are in Blahs. WDP 95/08
+
In the case of messing with @StgAddrs@ (@A_@), which are really \tr{void *},
we cast to @P_@, because you can't index off an uncast \tr{void *}.
for (p = result+MUTUPLE_HS; p < (result+MUTUPLE_HS+(n)); p++) { \
*p = (W_) (init); \
} \
- SET_ACTIVITY(ACT_REDN); /* back to normal reduction */\
\
r = result; \
}
void unblockUserSignals(STG_NO_ARGS);
IF_RTS(void blockVtAlrmSignal(STG_NO_ARGS);)
IF_RTS(void unblockVtAlrmSignal(STG_NO_ARGS);)
+IF_RTS(void AwaitEvent(I_ delta);)
#ifdef _POSIX_SOURCE
extern I_ sig_install PROTO((I_, I_, sigset_t *));
IF_RTS(I_ getSoftHeapOverflowHandler(STG_NO_ARGS);)
IF_RTS(extern StgStablePtr softHeapOverflowHandler;)
IF_RTS(void shutdownHaskell(STG_NO_ARGS);)
-IF_RTS(extern I_ noBlackHoles;)
-IF_RTS(extern I_ SM_word_stk_size;)
EXTFUN(stopPerformIODirectReturn);
EXTFUN(startPerformIO);
if (SHOULD_SPARK(node) && \
PendingSparksTl[ADVISORY_POOL] < PendingSparksLim[ADVISORY_POOL]) { \
*PendingSparksTl[ADVISORY_POOL]++ = (P_)(node); \
- } else if (DO_QP_PROF) { \
- I_ tid = threadId++; \
- SAFESTGCALL2(void,(I_, P_),QP_Event0,tid,node); \
+ } else { \
+ sparksIgnored++; \
+ if (DO_QP_PROF) { \
+ I_ tid = threadId++; \
+ SAFESTGCALL2(void,(I_, P_),QP_Event0,tid,node); \
+ } \
} \
r = 1; /* Should not be necessary */ \
}
Question: what's this "SET_ACTIVITY" stuff - should I be doing this
too? (It's if you want to use the SPAT profiling tools to
characterize program behavior by ``activity'' -- tail-calling,
-heap-checking, etc. -- see RednCounts.lh. It is quite specialized.
+heap-checking, etc. -- see Ticky.lh. It is quite specialized.
WDP 95/1)
\begin{code}