From cf7833edafa2dbf31ec7d29b51874dba6a92ae36 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Thu, 14 Jun 2018 16:45:22 +0100 Subject: Template BitTable based on the accessors. Test: test-art-host-gtest-stack_map_test Test: test-art-host-gtest-bit_table_test Change-Id: I96c04e21864009b64cb3177a0e9f0f8782a9b10b --- compiler/optimizing/stack_map_stream.cc | 10 +++++----- compiler/optimizing/stack_map_stream.h | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'compiler') diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc index 58a35dde8e..fb5d9332d0 100644 --- a/compiler/optimizing/stack_map_stream.cc +++ b/compiler/optimizing/stack_map_stream.cc @@ -56,14 +56,14 @@ void StackMapStream::BeginStackMapEntry(uint32_t dex_pc, DCHECK_EQ(num_dex_registers_, num_dex_registers) << "Inconsistent register count"; } - current_stack_map_ = BitTableBuilder::Entry(); + current_stack_map_ = BitTableBuilder::Entry(); current_stack_map_[StackMap::kKind] = static_cast(kind); current_stack_map_[StackMap::kPackedNativePc] = StackMap::PackNativePc(native_pc_offset, instruction_set_); current_stack_map_[StackMap::kDexPc] = dex_pc; if (register_mask != 0) { uint32_t shift = LeastSignificantBit(register_mask); - BitTableBuilder::Entry entry; + BitTableBuilder::Entry entry; entry[RegisterMask::kValue] = register_mask >> shift; entry[RegisterMask::kShift] = shift; current_stack_map_[StackMap::kRegisterMaskIndex] = register_masks_.Dedup(&entry); @@ -126,7 +126,7 @@ void StackMapStream::EndStackMapEntry() { void StackMapStream::AddInvoke(InvokeType invoke_type, uint32_t dex_method_index) { uint32_t packed_native_pc = current_stack_map_[StackMap::kPackedNativePc]; size_t invoke_info_index = invoke_infos_.size(); - BitTableBuilder::Entry entry; + BitTableBuilder::Entry entry; entry[InvokeInfo::kPackedNativePc] = packed_native_pc; entry[InvokeInfo::kInvokeType] = invoke_type; entry[InvokeInfo::kMethodInfoIndex] = method_infos_.Dedup({dex_method_index}); @@ -153,7 +153,7 @@ void StackMapStream::BeginInlineInfoEntry(ArtMethod* method, expected_num_dex_registers_ += num_dex_registers; - BitTableBuilder::Entry entry; + BitTableBuilder::Entry entry; entry[InlineInfo::kIsLast] = InlineInfo::kMore; entry[InlineInfo::kDexPc] = dex_pc; entry[InlineInfo::kNumberOfDexRegisters] = static_cast(expected_num_dex_registers_); @@ -215,7 +215,7 @@ void StackMapStream::CreateDexRegisterMap() { // Distance is difference between this index and the index of last modification. uint32_t distance = stack_maps_.size() - dex_register_timestamp_[i]; if (previous_dex_registers_[i] != reg || distance > kMaxDexRegisterMapSearchDistance) { - BitTableBuilder::Entry entry; + BitTableBuilder::Entry entry; entry[DexRegisterInfo::kKind] = static_cast(reg.GetKind()); entry[DexRegisterInfo::kPackedValue] = DexRegisterInfo::PackValue(reg.GetKind(), reg.GetValue()); diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h index 6842d9fd7e..7d1820d67f 100644 --- a/compiler/optimizing/stack_map_stream.h +++ b/compiler/optimizing/stack_map_stream.h @@ -103,26 +103,26 @@ class StackMapStream : public ValueObject { void CreateDexRegisterMap(); const InstructionSet instruction_set_; - BitTableBuilder stack_maps_; - BitTableBuilder register_masks_; + BitTableBuilder stack_maps_; + BitTableBuilder register_masks_; BitmapTableBuilder stack_masks_; - BitTableBuilder invoke_infos_; - BitTableBuilder inline_infos_; + BitTableBuilder invoke_infos_; + BitTableBuilder inline_infos_; BitmapTableBuilder dex_register_masks_; - BitTableBuilder dex_register_maps_; - BitTableBuilder dex_register_catalog_; + BitTableBuilder dex_register_maps_; + BitTableBuilder dex_register_catalog_; uint32_t num_dex_registers_ = 0; // TODO: Make this const and get the value in constructor. ScopedArenaVector out_; - BitTableBuilder<1> method_infos_; + BitTableBuilderBase<1> method_infos_; ScopedArenaVector lazy_stack_masks_; // Variables which track the current state between Begin/End calls; bool in_stack_map_; bool in_inline_info_; - BitTableBuilder::Entry current_stack_map_; - ScopedArenaVector::Entry> current_inline_infos_; + BitTableBuilder::Entry current_stack_map_; + ScopedArenaVector::Entry> current_inline_infos_; ScopedArenaVector current_dex_registers_; ScopedArenaVector previous_dex_registers_; ScopedArenaVector dex_register_timestamp_; // Stack map index of last change. @@ -131,7 +131,7 @@ class StackMapStream : public ValueObject { // Temporary variables used in CreateDexRegisterMap. // They are here so that we can reuse the reserved memory. ArenaBitVector temp_dex_register_mask_; - ScopedArenaVector::Entry> temp_dex_register_map_; + ScopedArenaVector::Entry> temp_dex_register_map_; // A set of lambda functions to be executed at the end to verify // the encoded data. It is generally only used in debug builds. -- cgit v1.2.3-59-g8ed1b