From ca6fff898afcb62491458ae8bcd428bfb3043da1 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 3 Oct 2017 14:49:14 +0100 Subject: ART: Use ScopedArenaAllocator for pass-local data. Passes using local ArenaAllocator were hiding their memory usage from the allocation counting, making it difficult to track down where memory was used. Using ScopedArenaAllocator reveals the memory usage. This changes the HGraph constructor which requires a lot of changes in tests. Refactor these tests to limit the amount of work needed the next time we change that constructor. Test: m test-art-host-gtest Test: testrunner.py --host Test: Build with kArenaAllocatorCountAllocations = true. Bug: 64312607 Change-Id: I34939e4086b500d6e827ff3ef2211d1a421ac91a --- compiler/optimizing/builder.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/builder.h') diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h index 9524fe2534..6c5985a3de 100644 --- a/compiler/optimizing/builder.h +++ b/compiler/optimizing/builder.h @@ -36,13 +36,12 @@ class CodeGenerator; class HGraphBuilder : public ValueObject { public: HGraphBuilder(HGraph* graph, - DexCompilationUnit* dex_compilation_unit, - const DexCompilationUnit* const outer_compilation_unit, + const DexCompilationUnit* dex_compilation_unit, + const DexCompilationUnit* outer_compilation_unit, CompilerDriver* driver, CodeGenerator* code_generator, OptimizingCompilerStats* compiler_stats, const uint8_t* interpreter_metadata, - Handle dex_cache, VariableSizedHandleScope* handles); // Only for unit testing. @@ -89,7 +88,7 @@ class HGraphBuilder : public ValueObject { // The compilation unit of the current method being compiled. Note that // it can be an inlined method. - DexCompilationUnit* const dex_compilation_unit_; + const DexCompilationUnit* const dex_compilation_unit_; CompilerDriver* const compiler_driver_; -- cgit v1.2.3-59-g8ed1b