diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-01-09 14:53:50 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-01-12 08:49:25 +0000 |
commit | 12df9ebf72255544b0147c81b1dca6644a29764e (patch) | |
tree | 93a47865d0c93922cfc036fba1f2490b64549912 /compiler/optimizing/code_generator.h | |
parent | 4270e74152d8a7cd979ab5a92fe2a8f84adb8a42 (diff) |
Move code around in OptimizingCompiler::Compile to reduce stack space.
Also fix an (intentional) memory leak, by allocating the CodeGenerator
on the heap instead of the arena: they construct an Assembler object
that requires destruction.
BUG:18787334
Change-Id: I8cf0667cb70ce5b14d4ac334bd4487a562635f1b
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r-- | compiler/optimizing/code_generator.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 4205ebebf9..bb0dda0170 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -77,16 +77,16 @@ class SlowPathCode : public ArenaObject<kArenaAllocSlowPaths> { DISALLOW_COPY_AND_ASSIGN(SlowPathCode); }; -class CodeGenerator : public ArenaObject<kArenaAllocMisc> { +class CodeGenerator { public: // Compiles the graph to executable instructions. Returns whether the compilation // succeeded. void CompileBaseline(CodeAllocator* allocator, bool is_leaf = false); void CompileOptimized(CodeAllocator* allocator); - static CodeGenerator* Create(ArenaAllocator* allocator, - HGraph* graph, + static CodeGenerator* Create(HGraph* graph, InstructionSet instruction_set, const InstructionSetFeatures& isa_features); + virtual ~CodeGenerator() {} HGraph* GetGraph() const { return graph_; } @@ -212,7 +212,6 @@ class CodeGenerator : public ArenaObject<kArenaAllocMisc> { slow_paths_(graph->GetArena(), 8), is_leaf_(true), stack_map_stream_(graph->GetArena()) {} - ~CodeGenerator() {} // Register allocation logic. void AllocateRegistersLocally(HInstruction* instruction) const; |