FDR: Squash buckets of included literals in FDR confirm

- Change the compile of literal matchers to two passes.
 - Reverse the bucket assignment in FDR, bucket with longer literals has
   smaller bucket id.
 - Squash the buckets of included literals and jump to the the program of
   included literals directly from parent literal program without going
   through FDR confirm for included iterals.
This commit is contained in:
Wang, Xiang W
2017-06-22 04:50:45 -04:00
committed by Matthew Barr
parent d2b5523dd8
commit 86c5f7feb1
26 changed files with 1017 additions and 262 deletions

View File

@@ -34,6 +34,7 @@
#define FDR_COMPILE_H
#include "ue2common.h"
#include "hwlm/hwlm_build.h"
#include "util/bytecode_ptr.h"
#include <vector>
@@ -46,18 +47,23 @@ struct hwlmLiteral;
struct Grey;
struct target_t;
bytecode_ptr<FDR> fdrBuildTable(const std::vector<hwlmLiteral> &lits,
bool make_small, const target_t &target,
const Grey &grey);
bytecode_ptr<FDR> fdrBuildTable(const HWLMProto &proto, const Grey &grey);
#if !defined(RELEASE_BUILD)
bytecode_ptr<FDR> fdrBuildTableHinted(const std::vector<hwlmLiteral> &lits,
bool make_small, u32 hint,
const target_t &target, const Grey &grey);
std::unique_ptr<HWLMProto> fdrBuildProtoHinted(
u8 engType,
std::vector<hwlmLiteral> lits,
bool make_small, u32 hint,
const target_t &target,
const Grey &grey);
#endif
std::unique_ptr<HWLMProto> fdrBuildProto(
u8 engType,
std::vector<hwlmLiteral> lits,
bool make_small, const target_t &target,
const Grey &grey);
/** \brief Returns size in bytes of the given FDR engine. */
size_t fdrSize(const struct FDR *fdr);