diff options
author | 2015-09-02 14:05:49 +0100 | |
---|---|---|
committer | 2015-09-02 20:16:58 +0100 | |
commit | f9f6441c665b5ff9004d3ed55014f46d416fb1bb (patch) | |
tree | 3d66a0b44e1ac927156eec6e6488de5fd52b982b /compiler/optimizing/code_generator.cc | |
parent | fe3879e6011f629d0dd6b04fab00b9496bd4ea08 (diff) |
Optimizing: Tag Arena allocations with their source.
This adds the ability to track where we allocate memory
when the kArenaAllocatorCountAllocations flag is turned on.
Also move some allocations from native heap to the Arena
and remove some unnecessary utilities.
Bug: 23736311
Change-Id: I1aaef3fd405d1de444fe9e618b1ce7ecef07ade3
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 7c60026642..3f69270f17 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -585,7 +585,7 @@ CodeGenerator* CodeGenerator::Create(HGraph* graph, } void CodeGenerator::BuildNativeGCMap( - std::vector<uint8_t>* data, const DexCompilationUnit& dex_compilation_unit) const { + ArenaVector<uint8_t>* data, const DexCompilationUnit& dex_compilation_unit) const { const std::vector<uint8_t>& gc_map_raw = dex_compilation_unit.GetVerifiedMethod()->GetDexGcMap(); verifier::DexPcToReferenceMap dex_gc_map(&(gc_map_raw)[0]); @@ -613,7 +613,7 @@ void CodeGenerator::BuildSourceMap(DefaultSrcMap* src_map) const { } } -void CodeGenerator::BuildMappingTable(std::vector<uint8_t>* data) const { +void CodeGenerator::BuildMappingTable(ArenaVector<uint8_t>* data) const { uint32_t pc2dex_data_size = 0u; uint32_t pc2dex_entries = stack_map_stream_.GetNumberOfStackMaps(); uint32_t pc2dex_offset = 0u; @@ -712,18 +712,16 @@ void CodeGenerator::BuildMappingTable(std::vector<uint8_t>* data) const { } } -void CodeGenerator::BuildVMapTable(std::vector<uint8_t>* data) const { - Leb128EncodingVector vmap_encoder; +void CodeGenerator::BuildVMapTable(ArenaVector<uint8_t>* data) const { + Leb128Encoder<ArenaAllocatorAdapter<uint8_t>> vmap_encoder(data); // We currently don't use callee-saved registers. size_t size = 0 + 1 /* marker */ + 0; vmap_encoder.Reserve(size + 1u); // All values are likely to be one byte in ULEB128 (<128). vmap_encoder.PushBackUnsigned(size); vmap_encoder.PushBackUnsigned(VmapTable::kAdjustedFpMarker); - - *data = vmap_encoder.GetData(); } -void CodeGenerator::BuildStackMaps(std::vector<uint8_t>* data) { +void CodeGenerator::BuildStackMaps(ArenaVector<uint8_t>* data) { uint32_t size = stack_map_stream_.PrepareForFillIn(); data->resize(size); MemoryRegion region(data->data(), size); |