chooseexecprogram:
cachedpr_trace = prog->trace;
- if (prvm_statementprofiling.integer || prog->trace || prog->watch_global_type != ev_void || prog->watch_field_type != ev_void || prog->break_statement >= 0 || (prvm_coverage.integer & 4))
+ if (prog->trace || prog->watch_global_type != ev_void || prog->watch_field_type != ev_void || prog->break_statement >= 0)
{
#define PRVMSLOWINTERPRETER 1
if (prvm_timeprofiling.integer)
chooseexecprogram:
cachedpr_trace = prog->trace;
- if (prvm_statementprofiling.integer || prog->trace || prog->watch_global_type != ev_void || prog->watch_field_type != ev_void || prog->break_statement >= 0 || (prvm_coverage.integer & 4))
+ if (prog->trace || prog->watch_global_type != ev_void || prog->watch_field_type != ev_void || prog->break_statement >= 0)
{
#define PRVMSLOWINTERPRETER 1
if (prvm_timeprofiling.integer)
chooseexecprogram:
cachedpr_trace = prog->trace;
- if (prvm_statementprofiling.integer || prog->trace || prog->watch_global_type != ev_void || prog->watch_field_type != ev_void || prog->break_statement >= 0 || (prvm_coverage.integer & 4))
+ if (prog->trace || prog->watch_global_type != ev_void || prog->watch_field_type != ev_void || prog->break_statement >= 0)
{
#define PRVMSLOWINTERPRETER 1
if (prvm_timeprofiling.integer)
-// NEED to reset startst after calling this!
+// NEED to reset startst after calling this! startst may or may not be clobbered!
#define ADVANCE_PROFILE_BEFORE_JUMP() \
- prog->xfunction->profile += (st - startst)
+ prog->xfunction->profile += (st - startst); \
+ if (prvm_statementprofiling.integer || (prvm_coverage.integer & 4)) { \
+ /* All statements from startst+1 to st have been hit. */ \
+ while (++startst <= st) { \
+ if (prog->statement_profile[startst - cached_statements]++ == 0 && (prvm_coverage.integer & 4)) \
+ PRVM_StatementCoverageEvent(prog, prog->xfunction, startst - cached_statements); \
+ } \
+ /* Observe: startst now is clobbered (now at st+1)! */ \
+ }
#ifdef PRVMTIMEPROFILING
#define PRE_ERROR() \
#if PRVMSLOWINTERPRETER
if (prog->trace)
PRVM_PrintStatement(prog, st);
- if (prog->statement_profile[st - cached_statements]++ == 0 && (prvm_coverage.integer & 4))
- PRVM_StatementCoverageEvent(prog, prog->xfunction, st - cached_statements);
if (prog->break_statement >= 0)
if ((st - cached_statements) == prog->break_statement)
{