diff options
author | Vladimir Marko <vmarko@google.com> | 2017-10-03 14:49:14 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2017-10-06 17:53:50 +0100 |
commit | ca6fff898afcb62491458ae8bcd428bfb3043da1 (patch) | |
tree | 195a6b16d3a4b34acc2faf91ce56f448efb15e07 /compiler/optimizing/load_store_analysis.h | |
parent | aa7273e56fbafc2692c8d20a31b50d2f4bdd2aa1 (diff) |
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
Diffstat (limited to 'compiler/optimizing/load_store_analysis.h')
-rw-r--r-- | compiler/optimizing/load_store_analysis.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/optimizing/load_store_analysis.h b/compiler/optimizing/load_store_analysis.h index d46b904c9e..6a25da3cfd 100644 --- a/compiler/optimizing/load_store_analysis.h +++ b/compiler/optimizing/load_store_analysis.h @@ -172,9 +172,9 @@ class HeapLocationCollector : public HGraphVisitor { explicit HeapLocationCollector(HGraph* graph) : HGraphVisitor(graph), - ref_info_array_(graph->GetArena()->Adapter(kArenaAllocLSE)), - heap_locations_(graph->GetArena()->Adapter(kArenaAllocLSE)), - aliasing_matrix_(graph->GetArena(), + ref_info_array_(graph->GetAllocator()->Adapter(kArenaAllocLSE)), + heap_locations_(graph->GetAllocator()->Adapter(kArenaAllocLSE)), + aliasing_matrix_(graph->GetAllocator(), kInitialAliasingMatrixBitVectorSize, true, kArenaAllocLSE), @@ -362,7 +362,7 @@ class HeapLocationCollector : public HGraphVisitor { ReferenceInfo* ref_info = FindReferenceInfoOf(instruction); if (ref_info == nullptr) { size_t pos = ref_info_array_.size(); - ref_info = new (GetGraph()->GetArena()) ReferenceInfo(instruction, pos); + ref_info = new (GetGraph()->GetAllocator()) ReferenceInfo(instruction, pos); ref_info_array_.push_back(ref_info); } return ref_info; @@ -385,7 +385,7 @@ class HeapLocationCollector : public HGraphVisitor { size_t heap_location_idx = FindHeapLocationIndex( ref_info, offset, index, declaring_class_def_index); if (heap_location_idx == kHeapLocationNotFound) { - HeapLocation* heap_loc = new (GetGraph()->GetArena()) + HeapLocation* heap_loc = new (GetGraph()->GetAllocator()) HeapLocation(ref_info, offset, index, declaring_class_def_index); heap_locations_.push_back(heap_loc); return heap_loc; |