remove lit program tables from bytecode

This commit is contained in:
Justin Viiret 2017-01-31 11:14:51 +11:00 committed by Matthew Barr
parent bd3357d3ac
commit 9550058e75
3 changed files with 4 additions and 30 deletions

View File

@ -4700,15 +4700,10 @@ map<u32, LitFragment> groupByFragment(const RoseBuildImpl &build) {
/**
* \brief Build the interpreter programs for each literal.
*
* Returns the following as a tuple:
*
* - base of the literal program list
* - base of the delay rebuild program list
* - total number of literal fragments
* Returns the total number of literal fragments.
*/
static
tuple<u32, u32, u32> buildLiteralPrograms(RoseBuildImpl &build,
build_context &bc) {
u32 buildLiteralPrograms(RoseBuildImpl &build, build_context &bc) {
// Build a reverse mapping from fragment -> final_id.
map<u32, flat_set<u32>> frag_to_final_map;
for (const auto &m : build.final_to_frag_map) {
@ -4740,13 +4735,7 @@ tuple<u32, u32, u32> buildLiteralPrograms(RoseBuildImpl &build,
frag.delay_program_offset = delayRebuildPrograms[frag.fragment_id];
}
u32 litProgramsOffset =
bc.engine_blob.add(begin(litPrograms), end(litPrograms));
u32 delayRebuildProgramsOffset = bc.engine_blob.add(
begin(delayRebuildPrograms), end(delayRebuildPrograms));
return tuple<u32, u32, u32>{litProgramsOffset, delayRebuildProgramsOffset,
num_fragments};
return num_fragments;
}
static
@ -5475,12 +5464,7 @@ aligned_unique_ptr<RoseEngine> RoseBuildImpl::buildFinalEngine(u32 minWidth) {
queue_count - leftfixBeginQueue, leftInfoTable,
&laggedRoseCount, &historyRequired);
u32 litProgramOffset;
u32 litDelayRebuildProgramOffset;
u32 litProgramCount;
tie(litProgramOffset, litDelayRebuildProgramOffset, litProgramCount) =
buildLiteralPrograms(*this, bc);
u32 litProgramCount = buildLiteralPrograms(*this, bc);
u32 delayProgramOffset = buildDelayPrograms(*this, bc);
u32 anchoredProgramOffset = buildAnchoredPrograms(*this, bc);
@ -5676,8 +5660,6 @@ aligned_unique_ptr<RoseEngine> RoseBuildImpl::buildFinalEngine(u32 minWidth) {
engine->needsCatchup = bc.needs_catchup ? 1 : 0;
engine->literalCount = litProgramCount;
engine->litProgramOffset = litProgramOffset;
engine->litDelayRebuildProgramOffset = litDelayRebuildProgramOffset;
engine->reportProgramOffset = reportProgramOffset;
engine->reportProgramCount = reportProgramCount;
engine->delayProgramOffset = delayProgramOffset;

View File

@ -1783,8 +1783,6 @@ void roseDumpStructRaw(const RoseEngine *t, FILE *f) {
DUMP_U32(t, eodmatcherMinWidth);
DUMP_U32(t, amatcherMaxBiAnchoredWidth);
DUMP_U32(t, fmatcherMaxBiAnchoredWidth);
DUMP_U32(t, litProgramOffset);
DUMP_U32(t, litDelayRebuildProgramOffset);
DUMP_U32(t, reportProgramOffset);
DUMP_U32(t, reportProgramCount);
DUMP_U32(t, delayProgramOffset);

View File

@ -344,12 +344,6 @@ struct RoseEngine {
u32 fmatcherMaxBiAnchoredWidth; /**< maximum number of bytes that can still
* produce a match for a pattern involved
* with the anchored table. */
/** \brief Offset of u32 array of program offsets for literals. */
u32 litProgramOffset;
/** \brief Offset of u32 array of delay rebuild program offsets for
* literals. */
u32 litDelayRebuildProgramOffset;
/**
* \brief Offset of u32 array of program offsets for reports used by