From 9550058e7529e87c654b5d6e7d92e7203fcd5898 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Tue, 31 Jan 2017 11:14:51 +1100 Subject: [PATCH] remove lit program tables from bytecode --- src/rose/rose_build_bytecode.cpp | 26 ++++---------------------- src/rose/rose_build_dump.cpp | 2 -- src/rose/rose_internal.h | 6 ------ 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/src/rose/rose_build_bytecode.cpp b/src/rose/rose_build_bytecode.cpp index 42142936..d8404db1 100644 --- a/src/rose/rose_build_bytecode.cpp +++ b/src/rose/rose_build_bytecode.cpp @@ -4700,15 +4700,10 @@ map 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 buildLiteralPrograms(RoseBuildImpl &build, - build_context &bc) { +u32 buildLiteralPrograms(RoseBuildImpl &build, build_context &bc) { // Build a reverse mapping from fragment -> final_id. map> frag_to_final_map; for (const auto &m : build.final_to_frag_map) { @@ -4740,13 +4735,7 @@ tuple 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{litProgramsOffset, delayRebuildProgramsOffset, - num_fragments}; + return num_fragments; } static @@ -5475,12 +5464,7 @@ aligned_unique_ptr 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 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; diff --git a/src/rose/rose_build_dump.cpp b/src/rose/rose_build_dump.cpp index 608141ed..f5cc86f0 100644 --- a/src/rose/rose_build_dump.cpp +++ b/src/rose/rose_build_dump.cpp @@ -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); diff --git a/src/rose/rose_internal.h b/src/rose/rose_internal.h index 8e55a37d..c8f47041 100644 --- a/src/rose/rose_internal.h +++ b/src/rose/rose_internal.h @@ -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