static bool fill_from_los_stack( msgc_context_t *context ) { int next, k, n, i; word obj; if (context->los_stack.stkp == context->los_stack.stkbot) { /* underflow */ if (!pop_segment( &context->los_stack )) return FALSE; } obj = *--context->los_stack.stkp; next = (int)*--context->los_stack.stkp; n = bytes2words( sizefield( *ptrof(obj) ) ); k = min( n-next, LARGE_OBJECT_LIMIT ); for ( i=0 ; i < k ; i++ ) PUSH( context, vector_ref( obj, i+next ) ); if (next+k < n) LOS_PUSH( context, next+k, obj ); return TRUE; }
static int push_constituents( msgc_context_t *context, word w ) { int i, n; switch (tagof(w)) { case PAIR_TAG : PUSH( context, pair_cdr( w ) ); /* Do the CDR last */ PUSH( context, pair_car( w ) ); /* Do the CAR first */ return 2; case VEC_TAG : case PROC_TAG : n = bytes2words( sizefield(*ptrof(w)) ); if (n > LARGE_OBJECT_LIMIT) LOS_PUSH( context, 0, w ); /* Treat large objects specially */ else for ( i=0 ; i < n ; i++ ) PUSH( context, vector_ref( w, i ) ); return n+1; default : return 0; } }
static int push_constituents( msgc_context_t *context, word w ) { int i, n; switch (tagof(w)) { case PAIR_TAG : return push_pair_constiuents( context, w ); case VEC_TAG : case PROC_TAG : assert2_tag_hdr_consistency( context, w ); n = bytes2words( sizefield(*ptrof(w)) ); if (n > LARGE_OBJECT_LIMIT) LOS_PUSH( context, 0, w ); /* Treat large objects specially */ else { assert2_object_contents_mapped( context, w, n ); for ( i=0 ; i < n ; i++ ) { PUSH( context, vector_ref( w, i ), w, i+1 ); } } return n+1; default : return 0; } }