core/x86/interp.c
/* helper routine for bb_process_fs_ref
 * return true if bb should be continued, false if it shouldn't  */
helper routine for bb_process_fs_ref
return true if bb should be continued, false if it shouldn't
helper routine for bb_process_fs_ref return true if bb should be continued false if it shouldn ' t
static bool
bb_process_fs_ref_opnd(dcontext_t *dcontext, build_bb_t *bb, opnd_t dst,
                       bool *is_to_fs0)
{
    ASSERT(is_to_fs0 != NULL);
    *is_to_fs0 = false;
    if (opnd_is_far_base_disp(dst) && 
        opnd_get_segment(dst) == SEG_FS) {
        if (bb->instr_start != bb->start_pc) {
            bb_stop_prior_to_instr(dcontext, bb, false);
            return false; 
        }
        if (bb->app_interp) {
            if (opnd_compute_address(dst, get_mcontext(dcontext)) == NULL) {
                *is_to_fs0 = true;
            }
        }
    }
    return true;
}
static bool bb_process_fs_ref_opnd ( dcontext_t * dcontext , build_bb_t * bb , opnd_t dst , bool * is_to_fs0 ) { ASSERT ( is_to_fs0 != NULL ) ; * is_to_fs0 = false ; if ( opnd_is_far_base_disp ( dst ) && opnd_get_segment ( dst ) == SEG_FS ) { if ( bb -> instr_start != bb -> start_pc ) { bb_stop_prior_to_instr ( dcontext , bb , false ) ; return false ; } if ( bb -> app_interp ) { if ( opnd_compute_address ( dst , get_mcontext ( dcontext ) ) == NULL ) { * is_to_fs0 = true ; } } } return true ; }
helper routine for bb_process_fs_ref
 return true if bb should be continued, false if it shouldn't
helper routine for bb_process_fs_ref return true if bb should be continued false if it shouldn ' t
/* FIXME - check size? */ /* is a write to fs:[*] */ /* Not first instruction in the bb, end bb before this
             * instruction, so we can see it as the first instruction of a
             * new bb where we can use the register state. */ /* As is, always ending the bb here has a mixed effect on mem usage
             * with default options.  We do end up with slightly more bb's
             * (and associated bookeeping costs), but frequently with MS dlls
             * we reduce code cache dupliaction from jmp/call ellision 
             * (_SEH_[Pro,Epi]log otherwise ends up frequently duplicated for
             * instance). */ /* FIXME - we must stop the bb here even if there's already
             * a bb built for the next instruction, as we have to have
             * reproducible bb building for recreate app state.  We should
             * only get here through code duplication (typically jmp/call
             * inlining, though can also be through multiple entry points into
             * the same block of non cti instructions). */ /*not appended yet*/ /* stop bb */ /* Only process the push if building a new bb for cache, can't check
         * this any earlier since have to preserve bb building/ending behavior
         * even when not for cache (for recreation etc.). */ /* check is write to fs:[0] */ /* we have new mov to fs:[0] */