31 Commits

Author SHA1 Message Date
Justin Viiret
159c09b70e roseEnginesEod: trust the queue structure 2016-07-08 10:55:36 +10:00
Justin Viiret
d9bd6d5dee roseSuffixesEod: trust the queue structure 2016-07-08 10:55:36 +10:00
Justin Viiret
3e0232f0d6 eod: retire getELiteralMatcher 2016-07-08 10:55:36 +10:00
Justin Viiret
78e4332a8b move eod iter program into general eod program 2016-07-08 10:55:36 +10:00
Justin Viiret
39461cc806 eod: move hwlm execution into MATCHER_EOD instr 2016-07-08 10:55:36 +10:00
Justin Viiret
2761e0105d eod: more suffix iteration into program 2016-07-08 10:54:07 +10:00
Justin Viiret
7a6a476723 eod: move engine checks into ENGINES_EOD instr 2016-07-08 10:54:07 +10:00
Justin Viiret
1df4da16ad rose: parameterise CHECK_LIT_EARLY 2016-07-08 10:47:33 +10:00
Justin Viiret
9e0ec02ac9 rose: assert that program offset is sane 2016-05-18 16:22:01 +10:00
Justin Viiret
1d85987d96 FINAL_REPORT: Add specialised instruction
Specialisation of the REPORT instruction that also terminates execution
of the program. Improves performance on programs that generate many
reports.
2016-04-20 13:34:57 +10:00
Justin Viiret
36150bbc19 Rose: replace internal_report with program
Replace the use of the internal_report structure (for reports from
engines, MPV etc) with the Rose program interpreter.

SOM processing was reworked to use a new som_operation structure that is
embedded in the appropriate instructions.
2016-04-20 13:34:57 +10:00
Justin Viiret
f2c0a66b6f Rose: use a multibit for the exhaustion vector
Previously, the exhaustion vector was a standard bitvector, which
required an expensive memset() call at init for databases with a large
number of exhaustion keys.
2016-04-20 13:34:55 +10:00
Justin Viiret
67b9784dae Rose: use program for all literal matches
Unifies all literal match paths so that the Rose program is used for all
of them. This removes the previous specialised "direct report" and
"multi direct report" paths. Some additional REPORT instruction work was
necessary for this.

Reworked literal construction path at compile time in prep for using
program offsets as literal IDs.

Completely removed the anchored log runtime, which is no longer worth
the extra complexity.
2016-04-20 13:34:54 +10:00
Justin Viiret
6e8f394d8d Make comparison signed (fix warning) 2016-03-01 11:36:09 +11:00
Justin Viiret
129578f970 Rose program: Improvements to debug/assertions
- Add current pc to debug printf.
- Assert that pc doesn't escape the RoseEngine structure.
2016-03-01 11:35:09 +11:00
Justin Viiret
5a1dd54049 Split CHECK_LEFTFIX into CHECK_{INFIX,PREFIX} 2016-03-01 11:35:08 +11:00
Justin Viiret
4d5710a84a Rename rosePrefixCheckMiracles to roseLeftfix... 2016-03-01 11:34:57 +11:00
Justin Viiret
8f3471dd4e Rename reduceQueue to reduceInfixQueue 2016-03-01 11:34:57 +11:00
Justin Viiret
bba8b62635 Use rose_inline rather than really_inline 2016-03-01 11:34:57 +11:00
Justin Viiret
fb8747295e roseTestLeftfix: unify common "nfa is dead" code 2016-03-01 11:34:57 +11:00
Justin Viiret
09bf568d95 Rose: clean up use of scratch, RoseContext 2016-03-01 11:32:11 +11:00
Justin Viiret
9e9bb6a960 Rose: pack global state bits into one u8
Eliminate the RoseRuntimeState structure in favour of a single status
byte that is stored in scratch and copied to/from stream state.
2016-03-01 11:32:01 +11:00
Justin Viiret
060defe6c4 Rose: move more report handling work into program
Move report preconditions (bounds, exhaustion, etc) into program
instructions and use a more direct path to the user match callback than
the adaptor functions.

Report handling has been moved to new file src/report.h. Reporting from
EOD now uses the same instructions as normal report handling, rather
than its own.

Jump target tracking in rose_build_bytecode.cpp has been cleaned up.
2016-03-01 11:32:01 +11:00
Justin Viiret
70620327cc Remove RoseContext::userCtx
All Rose callbacks receive scratch as their context.
2016-03-01 11:29:04 +11:00
Justin Viiret
de61b32e98 Use fatbit for anch log, delay slots in scratch
Since these structures are in scratch, they do not have to be as small
as possible and we can use fatbit instead of multibit to improve
performance.
2016-03-01 11:24:17 +11:00
Justin Viiret
8783750c72 Remove dupe engine, state ptrs from RoseContext
Remove the RoseEngine and stream state pointers frose RoseContext, as
they are also present in core_info.

Unify stream state handing in Rose to always use a char * (we were often
a u8 * for no particularly good reason) and tidy up.
2016-03-01 11:23:56 +11:00
Justin Viiret
10cda4cc33 Rose: Move all literal operations into program
Replace the RoseLiteral structure with more program instructions; now,
instead of each literal ID leading to a RoseLiteral, it simply has a
program to run (and a delay rebuild program).

This commit also makes some other improvements:

 * CHECK_STATE instruction, for use instead of a sparse iterator over a
   single element.
 * Elide some checks (CHECK_LIT_EARLY, ANCHORED_DELAY, etc) when not
   needed.
 * Flatten PUSH_DELAYED behaviour to one instruction per delayed
   literal, rather than the mask/index-list approach used before.
 * Simple program cache at compile time for deduplication.
2016-03-01 11:23:56 +11:00
Justin Viiret
48c9d7c381 Remove use of depth from Rose entirely 2016-03-01 11:23:11 +11:00
Justin Viiret
3d87e382fa Remove CHECK_DEPTH instruction 2016-03-01 11:23:11 +11:00
Justin Viiret
5fc4289dbe roseRunProgram: iter state on stack 2016-03-01 11:20:36 +11:00
Justin Viiret
b2ebdac642 rose: Extend program to handle literals, iterators
- cleanups
- add sparse iter instructions
- merge "root" and "sparse iter" programs together
- move program execution to new file program_runtime.h
- simplify EOD execution
2016-03-01 11:17:31 +11:00