diff options
author | 2018-09-11 12:35:30 -0700 | |
---|---|---|
committer | 2018-09-12 11:32:40 -0700 | |
commit | 3e2e123239952c80e1b37431bf2efbbe07a41940 (patch) | |
tree | 153be0dafdbce55b5e5432cb10025b802a637402 /compiler/optimizing/instruction_builder.cc | |
parent | 68851b53e4152d3edaea977573af8bdc0bd23313 (diff) |
Refactor debug info position visiting
Move logic to CodeItemDebugInfoAccessor, makes it easier to modify
the debug info format.
Test: test-art-host
Bug: 112311591
Bug: 77709234
Change-Id: Ice56a88951efa54dc07d88f2c228c01be4670e73
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r-- | compiler/optimizing/instruction_builder.cc | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index e555d0d890..034761db57 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -466,22 +466,17 @@ void HInstructionBuilder::BuildIntrinsic(ArtMethod* method) { } ArenaBitVector* HInstructionBuilder::FindNativeDebugInfoLocations() { - // The callback gets called when the line number changes. - // In other words, it marks the start of new java statement. - struct Callback { - static bool Position(void* ctx, const DexFile::PositionInfo& entry) { - static_cast<ArenaBitVector*>(ctx)->SetBit(entry.address_); - return false; - } - }; ArenaBitVector* locations = ArenaBitVector::Create(local_allocator_, code_item_accessor_.InsnsSizeInCodeUnits(), /* expandable */ false, kArenaAllocGraphBuilder); locations->ClearAllBits(); - dex_file_->DecodeDebugPositionInfo(code_item_accessor_.DebugInfoOffset(), - Callback::Position, - locations); + // The visitor gets called when the line number changes. + // In other words, it marks the start of new java statement. + code_item_accessor_.DecodeDebugPositionInfo([&](const DexFile::PositionInfo& entry) { + locations->SetBit(entry.address_); + return false; + }); // Instruction-specific tweaks. for (const DexInstructionPcPair& inst : code_item_accessor_) { switch (inst->Opcode()) { |