202 Commits

Author SHA1 Message Date
Matthew Barr
7849b9d611 MSVC prefers the attrib at the beginning 2016-10-28 14:48:31 +11:00
Justin Viiret
6e533589bb rose: move END instruction to start of enum
Stop overloading END as the last Rose interpreter instruction, use new
sentinel LAST_ROSE_INSTRUCTION for that.

This change will also make it easier to add new instructions without
renumbering END and thus changing all generated bytecodes.
2016-10-28 14:47:07 +11:00
Xu, Chi
997787bd4b rose: add CHECK_SINGLE_LOOKAROUND instruction
This specialisation is cheaper than the shufti-based variants, so we
prefer it for single character class tests.
2016-10-28 14:47:04 +11:00
Justin Viiret
385f71b44e rose: enable generation of shufti32x16 case 2016-10-28 14:46:37 +11:00
Xu, Chi
04d79629de rose: add shufti-based lookaround instructions
More lookaround specialisations that use the shufti approach.
2016-10-28 14:46:27 +11:00
Justin Viiret
9139123642 rose: move sparse iter cache to RoseEngineBlob
This enables its use for iterators written by instructions.
2016-10-28 14:45:32 +11:00
Justin Viiret
13b6023a18 hash: add hash_all variadic tpl func, use in rose 2016-10-28 14:45:28 +11:00
Justin Viiret
13af3bfb74 rose: decouple build-time program representation
This commit replaces the build-time representation of the Rose
interpreter programs, from a class containing a discriminated union of
the bytecode structures to a class hierarchy of build-time prototypes.

This makes it easier to reason about and manipulate Rose programs during
compilation.
2016-10-28 14:45:15 +11:00
Justin Viiret
f4fa6cd4dd rose: tighten up requirements for catch up
We only need to catch up when there is an actual anchored table, not
merely when there are successors of anchored_root in the Rose graph.
2016-10-28 14:44:20 +11:00
Justin Viiret
3cf4199879 debug: always use %zu in format string for size_t 2016-10-28 14:43:34 +11:00
Justin Viiret
c8868fb9c7 rose: remove CHECK_LIT_MASK instruction 2016-10-28 14:43:33 +11:00
Justin Viiret
4ce306864e rose: use lookarounds to implement benefits masks
This replaces the CHECK_LIT_MASK instruction.
2016-10-28 14:43:33 +11:00
Xu, Chi
b96d5c23d1 rose: add new instruction CHECK_MASK_32
This is a specialisation of the "lookaround" code.
2016-10-28 14:43:33 +11:00
Justin Viiret
8be6c8b2ca rose: don't merge large acyclic suffixes
Check earlier on in mergeSuffixes that we're not proposing to merge
suffixes above our limit from the acyclic merge path.
2016-10-28 14:43:33 +11:00
Alex Coyte
e6c05d5a55 set an appropriate default value for RoleInfo::score
Coverity CID 131843
2016-08-22 16:03:51 +10:00
Justin Viiret
ae14187462 rose: use min of max_offset in left merges
Be more careful with max_offset, since we rely on it ofr ANCH history
cases. Also adds tighter assertions.
2016-08-10 15:12:12 +10:00
Justin Viiret
cec57d7e90 rose: ensure anch small block literals have bounds 2016-08-10 15:12:04 +10:00
Justin Viiret
e03375b644 program_runtime: remove commented-out code 2016-08-10 15:11:15 +10:00
Anatoly Burakov
6331da4e29 dfa: adding new Sheng engine
A new shuffle-based DFA engine, complete with acceleration and smallwrite.
2016-08-10 15:10:46 +10:00
Alex Coyte
093029b5d1 add a csv version of rose_components 2016-08-10 15:10:09 +10:00
Alex Coyte
cded5552c2 rose: don't leave stray reports when copying the subgraph leading to a report 2016-08-10 15:09:27 +10:00
Matthew Barr
151810b4fc Older gcc doesn't like shadowing the function 2016-08-10 15:07:11 +10:00
Matthew Barr
cbd115f7fe Don't shadow names 2016-08-10 15:06:57 +10:00
Justin Viiret
55c2d20e2c rose: use dumpString for debug output 2016-08-10 15:06:22 +10:00
Justin Viiret
1ff17a2ea3 rose: clear reports in removeFalsePaths 2016-08-10 15:06:01 +10:00
Justin Viiret
7f49958824 rose: only write out report programs if in use
These programs are only used by output-exposed engines.
2016-08-10 15:05:53 +10:00
Alex Coyte
d574557200 take mask overhang into account for hwlm accel, float min dist 2016-08-10 15:05:19 +10:00
Alex Coyte
5c5ec905cc violet: initial implementation 2016-08-10 15:01:08 +10:00
Alex Coyte
b13a90e5d2 compiledump: allow disabling of early graphs for large compiles 2016-08-10 15:00:44 +10:00
Justin Viiret
9eb349a343 rose: expose smwr builder, tidy up engine build 2016-08-10 14:59:10 +10:00
Justin Viiret
a427a2843b rose_build_anchored: clean up remapping
Note that there are no EOD reports in the anchored matcher raw_dfas.
2016-08-10 14:59:10 +10:00
Justin Viiret
210246af01 rose_build_anchored: remove unused forward decls 2016-08-10 14:59:10 +10:00
Justin Viiret
8754cbbd24 rose: use program offset, not final_id, in atable
This removes the need to look up the program offset in a table when
handling an anchored literal match.
2016-08-10 14:59:10 +10:00
Justin Viiret
4dbbc4eaa5 rose: add RECORD_ANCHORED instruction to program
Moves recordAnchoredLiteralMatch from an unconditional call in the
anchored callback to being driven by a program instruction.
2016-08-10 14:59:10 +10:00
Alex Coyte
981b59fd05 minor eager prefixes improvements
- count eager prefixes as always run engine when comparing with smwr
 - only check if a prefix is vacuous after adding back literal fragments
2016-08-10 14:59:10 +10:00
Justin Viiret
aed2e721f4 rose: tidy up CHECK_{BYTE,MASK} dump code 2016-08-10 14:57:48 +10:00
Xu, Chi
4d7469392d rose: add CHECK_BYTE/CHECK_MASK instructions
These instructions are specialisations of the "lookaround" code for
performance.
2016-08-10 14:57:48 +10:00
Justin Viiret
1bab10698f rose_build_convert: improve history selection
Fixes assertion failures introduced by last commit.
2016-08-10 14:57:42 +10:00
Justin Viiret
3e96cd48ef rose: sanity check CHECK_BOUNDS instruction 2016-08-10 14:57:36 +10:00
Justin Viiret
8d31607556 rose: only use anch history when there are bounds 2016-08-10 14:57:36 +10:00
Justin Viiret
6ec93a54c4 rose: only dump small-block table in block mode 2016-08-10 14:57:20 +10:00
Justin Viiret
39c6a0c7bf rose: check literal bounds when building SB table
Literals that cannot lead to a report in the first ROSE_SMALL_BLOCK_LEN
bytes may be dropped from the small block table.
2016-08-10 14:56:12 +10:00
Justin Viiret
790683b641 rose: don't always dedupe small-block lit variants 2016-08-10 14:52:56 +10:00
Alex Coyte
691b08d170 use NGHolder::foo in favour of NFAGraph::foo 2016-08-10 14:52:56 +10:00
Alex Coyte
2471b770a8 we no longer store the history len 2016-08-10 14:52:56 +10:00
Alex Coyte
3a1429a621 group_weak_end is no longer used 2016-08-10 14:52:56 +10:00
Justin Viiret
d497a1259a rose: use normal callback for pure-literal cases 2016-08-10 14:52:56 +10:00
Justin Viiret
7cc5346c11 assign groups: turn pair<pair> into a tuple 2016-08-10 14:49:24 +10:00
Justin Viiret
bfaa0acaea rose: preserve lit properties when building masks
This fixes a bug with commit 6a6b0e5, which did not preserve the
requires_explode and requires_benefits properties when a new literal was
generated to add an HWLM and/cmp mask.

Also extends the requires_explode handling to allow masked literals.
2016-08-10 14:48:29 +10:00
Justin Viiret
e9cfbae68f workaround for freebsd/clang/libc++ build issues
Rather than relying on set's constructor from {}, explicitly construct
the set.
2016-07-08 11:07:51 +10:00