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

View File

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

View File

@ -344,12 +344,6 @@ struct RoseEngine {
u32 fmatcherMaxBiAnchoredWidth; /**< maximum number of bytes that can still u32 fmatcherMaxBiAnchoredWidth; /**< maximum number of bytes that can still
* produce a match for a pattern involved * produce a match for a pattern involved
* with the anchored table. */ * 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 * \brief Offset of u32 array of program offsets for reports used by