mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-18 02:00:36 +03:00
fdr: move long literal handling into Rose
Move the hash table used for long literal support in streaming mode from FDR to Rose, and introduce new instructions CHECK_LONG_LIT and CHECK_LONG_LIT_NOCASE for doing literal confirm for long literals. This simplifies FDR confirm, and guarantees that HWLM matchers will only be used for literals < 256 bytes long.
This commit is contained in:
committed by
Matthew Barr
parent
6ed30194ce
commit
68bf473e2e
@@ -495,6 +495,24 @@ void RoseInstrEnginesEod::write(void *dest, RoseEngineBlob &blob,
|
||||
inst->iter_offset = iter_offset;
|
||||
}
|
||||
|
||||
void RoseInstrCheckLongLit::write(void *dest, RoseEngineBlob &blob,
|
||||
const OffsetMap &offset_map) const {
|
||||
RoseInstrBase::write(dest, blob, offset_map);
|
||||
auto *inst = static_cast<impl_type *>(dest);
|
||||
assert(!literal.empty());
|
||||
inst->lit_offset = blob.add(literal.c_str(), literal.size(), 1);
|
||||
inst->lit_length = verify_u32(literal.size());
|
||||
}
|
||||
|
||||
void RoseInstrCheckLongLitNocase::write(void *dest, RoseEngineBlob &blob,
|
||||
const OffsetMap &offset_map) const {
|
||||
RoseInstrBase::write(dest, blob, offset_map);
|
||||
auto *inst = static_cast<impl_type *>(dest);
|
||||
assert(!literal.empty());
|
||||
inst->lit_offset = blob.add(literal.c_str(), literal.size(), 1);
|
||||
inst->lit_length = verify_u32(literal.size());
|
||||
}
|
||||
|
||||
static
|
||||
OffsetMap makeOffsetMap(const RoseProgram &program, u32 *total_len) {
|
||||
OffsetMap offset_map;
|
||||
|
||||
Reference in New Issue
Block a user