Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: courgette/courgette_flow.h

Issue 2854113002: [Courgette] Reduce AssemblyProgram to reduce Courgette-apply RAM floor and disk churn. (Closed)
Patch Set: Update courgette_fuzzer in libfuzzer. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/assembly_program.cc ('k') | courgette/courgette_flow.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/courgette_flow.h
diff --git a/courgette/courgette_flow.h b/courgette/courgette_flow.h
index 9b8cb889126fd1e29c4e86a459aa945c84bee781..5544521238709da73059f0b7ab8c62f733f42a4b 100644
--- a/courgette/courgette_flow.h
+++ b/courgette/courgette_flow.h
@@ -16,6 +16,7 @@
namespace courgette {
class AssemblyProgram;
+class Disassembler;
class EncodedProgram;
// An adaptor for Region as BasicBuffer.
@@ -47,6 +48,7 @@ class CourgetteFlow {
Data();
~Data();
+ std::unique_ptr<Disassembler> disassembler;
std::unique_ptr<AssemblyProgram> program;
std::unique_ptr<EncodedProgram> encoded;
SinkStreamSet sinks;
@@ -78,12 +80,8 @@ class CourgetteFlow {
// Reads |buffer| to initialize |data(group)->sources|.
void ReadSourceStreamSetFromBuffer(Group group, const BasicBuffer& buffer);
- // Reads |buffer| to initialize |data(group)->program|, passing |annotate| as
- // initialization parameter (true if AdjustNewAssemblyProgramToMatchOld() gets
- // called later).
- void ReadAssemblyProgramFromBuffer(Group group,
- const BasicBuffer& buffer,
- bool annotate);
+ // Reads |buffer| to initialize |data(group)->disassembler|.
+ void ReadDisassemblerFromBuffer(Group group, const BasicBuffer& buffer);
// Reads |opt_sources| if given, or else |data(group)->sources| to initialize
// |data(group).encoded|.
@@ -91,8 +89,14 @@ class CourgetteFlow {
Group group,
SourceStreamSet* opt_sources = nullptr);
- // Uses |data(group)->program| to initialize |data(group)->encoded|.
- void CreateEncodedProgramFromAssemblyProgram(Group group);
+ // Uses |data(group)->disassembler| to initialize |data(group)->program|,
+ // passing |annotate| as initialization parameter (should be true if
+ // AdjustNewAssemblyProgramToMatchOld() gets called later).
+ void CreateAssemblyProgramFromDisassembler(Group group, bool annotate);
+
+ // Uses |data(group)->disassembler| and |data(group)->program| to initialize
+ // |data(group)->encoded|.
+ void CreateEncodedProgramFromDisassemblerAndAssemblyProgram(Group group);
// Serializese |data(group)->sinks| to |sink|.
void WriteSinkStreamFromSinkStreamSet(Group group, SinkStream* sink);
@@ -111,6 +115,8 @@ class CourgetteFlow {
// Destructor commands to reduce memory usage.
+ void DestroyDisassembler(Group group);
+
void DestroyAssemblyProgram(Group group);
void DestroyEncodedProgram(Group group);
« no previous file with comments | « courgette/assembly_program.cc ('k') | courgette/courgette_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698