Branch: Tag:

2018-03-30

2018-03-30 16:06:38 by Arne Goedeke <el@laramies.com>

Interpreter: replace DO_IF_* macros where possible

880:    num_bitmask_entries = offset + 1;    }    } else { -  DO_IF_DEBUG( + #ifdef PIKE_DEBUG    if( (locals + _fp_->num_locals > Pike_sp) ||    (Pike_sp < locals + exp_offset) ||    (exp_offset < 0) || (exp_offset > _fp_->num_locals))
888:    "%p+%d=%p %p %hd!n",    locals, _fp_->num_locals,    locals + _fp_->num_locals, -  Pike_sp, exp_offset)); +  Pike_sp, exp_offset); + #endif    }       num_new_locals = MAXIMUM(exp_offset, num_bitmask_entries << 4);
934:   PIKE_UNUSED_ATTRIBUTE   static inline void POP_PIKE_FRAME(void) {    struct pike_frame *_fp_ = Pike_fp; -  DO_IF_PROFILING({ + #ifdef PROFILING    /* Time spent in this frame + children. */ -  cpu_time_t time_passed = -  get_cpu_time() - Pike_interpreter.unlocked_time; +  cpu_time_t time_passed = get_cpu_time() - Pike_interpreter.unlocked_time;    /* Time spent in children to this frame. */    cpu_time_t time_in_children;    /* Time spent in just this frame. */
951:    Pike_interpreter.accounted_time,    _fp_->children_base);    time_passed -= _fp_->start_time; -  DO_IF_DEBUG(if (time_passed < 0) { + # ifdef PIKE_DEBUG +  if (time_passed < 0) {    Pike_fatal("Negative time_passed: %" PRINT_CPU_TIME    " now: %" PRINT_CPU_TIME    " unlocked_time: %" PRINT_CPU_TIME
959:    "n", time_passed, get_cpu_time(),    Pike_interpreter.unlocked_time,    _fp_->start_time); -  }); -  time_in_children = -  Pike_interpreter.accounted_time - _fp_->children_base; -  DO_IF_DEBUG(if (time_in_children < 0) { +  } + # endif /* PIKE_DEBUG */ +  time_in_children = Pike_interpreter.accounted_time - _fp_->children_base; + # ifdef PIKE_DEBUG +  if (time_in_children < 0) {    Pike_fatal("Negative time_in_children: %"    PRINT_CPU_TIME    " accounted_time: %" PRINT_CPU_TIME
970:    "n", time_in_children,    Pike_interpreter.accounted_time,    _fp_->children_base); -  }); +  } + # endif /* PIKE_DEBUG */    self_time = time_passed - time_in_children; -  DO_IF_DEBUG(if (self_time < 0) { + # ifdef PIKE_DEBUG +  if (self_time < 0) {    Pike_fatal("Negative self_time: %" PRINT_CPU_TIME    " time_passed: %" PRINT_CPU_TIME    " time_in_children: %" PRINT_CPU_TIME    "n", self_time, time_passed,    time_in_children); -  }); +  } + # endif /* PIKE_DEBUG */    Pike_interpreter.accounted_time += self_time;    /* FIXME: Can context->prog be NULL? */    function = _fp_->context->prog->identifiers + _fp_->ident;    if (!--function->recur_depth)    function->total_time += time_passed;    function->self_time += self_time; -  }); + #endif /* PROFILING */ +     LOW_POP_PIKE_FRAME (_fp_);   }      #endif