eod: tidy runtime

This commit is contained in:
Justin Viiret 2016-06-14 10:56:30 +10:00 committed by Matthew Barr
parent 78e4332a8b
commit ae157034e9

View File

@ -55,11 +55,17 @@ void initContext(const struct RoseEngine *t, u64a offset,
fatbit_clear(scratch->aqa); fatbit_clear(scratch->aqa);
} }
static rose_inline static really_inline
int roseRunEodProgram(const struct RoseEngine *t, u64a offset, void roseEodExec_i(const struct RoseEngine *t, u64a offset,
struct hs_scratch *scratch) { struct hs_scratch *scratch, UNUSED const char is_streaming) {
assert(t);
assert(scratch->core_info.buf || scratch->core_info.hbuf);
assert(!scratch->core_info.buf || !scratch->core_info.hbuf);
assert(!can_stop_matching(scratch));
if (!t->eodProgramOffset) { if (!t->eodProgramOffset) {
return MO_CONTINUE_MATCHING; DEBUG_PRINTF("no eod program\n");
return;
} }
DEBUG_PRINTF("running eod program at %u\n", t->eodProgramOffset); DEBUG_PRINTF("running eod program at %u\n", t->eodProgramOffset);
@ -73,25 +79,11 @@ int roseRunEodProgram(const struct RoseEngine *t, u64a offset,
const char in_catchup = 0; const char in_catchup = 0;
const char from_mpv = 0; const char from_mpv = 0;
const char skip_mpv_catchup = 1; const char skip_mpv_catchup = 1;
if (roseRunProgram(t, scratch, t->eodProgramOffset, som, offset, match_len,
in_anchored, in_catchup, from_mpv,
skip_mpv_catchup) == HWLM_TERMINATE_MATCHING) {
return MO_HALT_MATCHING;
}
return MO_CONTINUE_MATCHING; // Note: we ignore the result, as this is the last thing to ever happen on
} // a scan.
roseRunProgram(t, scratch, t->eodProgramOffset, som, offset, match_len,
static really_inline in_anchored, in_catchup, from_mpv, skip_mpv_catchup);
void roseEodExec_i(const struct RoseEngine *t, u64a offset,
struct hs_scratch *scratch, UNUSED const char is_streaming) {
assert(t);
assert(scratch->core_info.buf || scratch->core_info.hbuf);
assert(!scratch->core_info.buf || !scratch->core_info.hbuf);
assert(!can_stop_matching(scratch));
// Run the unconditional EOD program.
roseRunEodProgram(t, offset, scratch);
} }
void roseEodExec(const struct RoseEngine *t, u64a offset, void roseEodExec(const struct RoseEngine *t, u64a offset,