44 Commits

Author SHA1 Message Date
Justin Viiret
c101beb541 castle, lbr: native report remap 2016-05-18 16:21:36 +10:00
Justin Viiret
1f41a921f2 mcclellan, gough: native report remapping 2016-05-18 16:20:45 +10:00
Justin Viiret
611579511c rose: remap reports to program offsets 2016-05-18 16:20:42 +10:00
Justin Viiret
f40aa6bd40 report_manager: store report -> program mapping 2016-05-18 16:20:38 +10:00
Justin Viiret
319d47ae4f Remove OutfixInfo::chained (which meant "is MPV") 2016-04-20 13:34:57 +10:00
Justin Viiret
16985ab6e5 Use a visitor for outfix engine construction 2016-04-20 13:34:57 +10:00
Justin Viiret
32c866a8f9 OutfixInfo: use boost::variant for engines 2016-04-20 13:34:57 +10:00
Justin Viiret
fa27025bcb Wrap MPV puffettes in a struct 2016-04-20 13:34:57 +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
9c9eb2ca9a makeReport: remove unused param 2016-04-20 13:34:54 +10:00
Justin Viiret
ff7e101757 Rose: be more precise with CATCHUP instruction
- Fix bugs introduced by recent addition of the boundary program. It's
  not safe to do catchup there.
- Only do catchup once per report set, when necessary.
2016-04-20 13:34:54 +10:00
Justin Viiret
93a262e54c Rose: use program for boundary reports
Use the program to handle report lists at boundaries, rather than the
previous list-of-reports approach.
2016-04-20 13:34:54 +10:00
Justin Viiret
b093616aff Rose build: move HWLM build code to own file
To reduce the size of rose_build_bytecode.cpp a little, move the code
that deals with HWLM literal tables into its own new file.
2016-04-20 13:34:54 +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
cc5db61686 Rose: allow DR literals to share vertices 2016-03-01 11:36:09 +11:00
Justin Viiret
5a1dd54049 Split CHECK_LEFTFIX into CHECK_{INFIX,PREFIX} 2016-03-01 11:35:08 +11:00
Justin Viiret
996eba9686 Add CATCH_UP to report_block, not "parent" program
Also ensure that exhaustion check happens after catch up, as catch up
may fire reports (which could exhaust).
2016-03-01 11:34:57 +11:00
Justin Viiret
961e303ff3 SET_GROUPS instr: don't generate more than one 2016-03-01 11:34:26 +11:00
Justin Viiret
cd133f77ee DEDUPE instr: generate only when necessary 2016-03-01 11:34: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
28f379d738 Rose: remove alignment req for anchored DFA 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
9eb328b455 RoseRuntimeState no longer needs to be packed
This structure only contains u8 values now. In the future we may wish to
eliminate it entirely and store the few bits we need more directly.
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
1c2fca8840 rose_build_anchored: take ref, not pointer 2016-03-01 11:24:17 +11:00
Justin Viiret
69682ed263 Account for multi-dfa case with ANCHORED_DELAY
Specifically, we must set build_context::floatingMinLiteralMatchOffset
to 1 when thew anchored table contains multiple DFAs, as they can
produce unordered matches.

This check was already been done, but too late to affect the generation
of ANCHORED_DELAY instructions.
2016-03-01 11:24:13 +11:00
Justin Viiret
d7c8ffc7fd Use correct type for anchored matcher build 2016-03-01 11:24:09 +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
Matthew Barr
fe475cc069 alignof() should operate on a type-id 2016-03-01 11:23:48 +11:00
Justin Viiret
fafcc83520 Delete unused build_context::depths 2016-03-01 11:23:11 +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
b2a76e6e2b roseCheckNfaEod: use sparse iterator for EOD
Rather than checking all active outfix/suffix engines, use a sparse
iterator to check only those engines that accept at EOD.
2016-03-01 11:20:26 +11:00
Justin Viiret
b6508811c0 writeEodProgram: avoid make_move_iterator warning
Avoid an ambiguity between std:: and boost::make_move_iterator on builds
against libc++.
2016-03-01 11:18:17 +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
Justin Viiret
86a52971ca Remove dead code: EdgeSourceStateCompare 2016-03-01 11:16:13 +11:00
Justin Viiret
d67c7583ea rose: Extend the interpreter to handle more work
- Use program for EOD sparse iterator
- Use program for literal sparse iterator
- Eliminate RoseRole, RosePred, RoseVertexProps::role
- Small performance optimizations
2016-03-01 11:16:02 +11:00
Justin Viiret
9cb2233589 rose: Use an interpreter for role runtime
Replace much of the RoseRole structure with an interpreted program,
simplifying the Rose runtime and making it much more flexible.
2016-03-01 11:16:02 +11:00
Alex Coyte
a7d8dafb71 detach the sidecar 2016-03-01 11:13:23 +11:00
Justin Viiret
2a2576e907 Introduce copy_bytes for writing into bytecode
Protects memcpy from nullptr sources, which triggers failures in GCC's
UB sanitizer.
2015-11-18 15:26:16 +11:00
Justin Viiret
55b357f7d1 Remove enum mqe_event and use u32 for queue events
We were using intermediate values int he enum and casting back and forth
with a u32; it is cleaner to just use a u32 and define some special
values.

Silences ICC warning #188: enumerated type mixed with another type.
2015-10-30 11:28:37 +11:00
Matthew Barr
904e436f11 Initial commit of Hyperscan 2015-10-20 09:13:35 +11:00