diff options
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 12 | ||||
-rw-r--r-- | compiler/optimizing/stack_map_stream.cc | 21 | ||||
-rw-r--r-- | compiler/optimizing/stack_map_stream.h | 4 | ||||
-rw-r--r-- | compiler/optimizing/stack_map_test.cc | 52 |
4 files changed, 0 insertions, 89 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 074f249fe1..0ebf4bec0a 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -70,9 +70,6 @@ namespace art { -// If true, we record the static and direct invokes in the invoke infos. -static constexpr bool kEnableDexLayoutOptimizations = false; - // Return whether a location is consistent with a type. static bool CheckType(DataType::Type type, Location location) { if (location.IsFpuRegister() @@ -1136,15 +1133,6 @@ void CodeGenerator::RecordPcInfo(HInstruction* instruction, locations->GetStackMask(), kind); EmitEnvironment(environment, slow_path); - // Record invoke info, the common case for the trampoline is super and static invokes. Only - // record these to reduce oat file size. - if (kEnableDexLayoutOptimizations) { - if (instruction->IsInvokeStaticOrDirect()) { - HInvoke* const invoke = instruction->AsInvokeStaticOrDirect(); - DCHECK(environment != nullptr); - stack_map_stream->AddInvoke(invoke->GetInvokeType(), invoke->GetDexMethodIndex()); - } - } stack_map_stream->EndStackMapEntry(); if (osr) { diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc index 3e1a36dc9b..a65fbcc514 100644 --- a/compiler/optimizing/stack_map_stream.cc +++ b/compiler/optimizing/stack_map_stream.cc @@ -156,26 +156,6 @@ 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<InvokeInfo>::Entry entry; - entry[InvokeInfo::kPackedNativePc] = packed_native_pc; - entry[InvokeInfo::kInvokeType] = invoke_type; - entry[InvokeInfo::kMethodInfoIndex] = method_infos_.Dedup({dex_method_index}); - invoke_infos_.Add(entry); - - if (kVerifyStackMaps) { - dchecks_.emplace_back([=](const CodeInfo& code_info) { - InvokeInfo invoke_info = code_info.GetInvokeInfo(invoke_info_index); - CHECK_EQ(invoke_info.GetNativePcOffset(instruction_set_), - StackMap::UnpackNativePc(packed_native_pc, instruction_set_)); - CHECK_EQ(invoke_info.GetInvokeType(), invoke_type); - CHECK_EQ(method_infos_[invoke_info.GetMethodInfoIndex()][0], dex_method_index); - }); - } -} - void StackMapStream::BeginInlineInfoEntry(ArtMethod* method, uint32_t dex_pc, uint32_t num_dex_registers, @@ -333,7 +313,6 @@ size_t StackMapStream::PrepareForFillIn() { stack_maps_.Encode(out); register_masks_.Encode(out); stack_masks_.Encode(out); - invoke_infos_.Encode(out); inline_infos_.Encode(out); dex_register_masks_.Encode(out); dex_register_maps_.Encode(out); diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h index ed865b12f7..203c2cdf84 100644 --- a/compiler/optimizing/stack_map_stream.h +++ b/compiler/optimizing/stack_map_stream.h @@ -42,7 +42,6 @@ class StackMapStream : public ValueObject { stack_maps_(allocator), register_masks_(allocator), stack_masks_(allocator), - invoke_infos_(allocator), inline_infos_(allocator), dex_register_masks_(allocator), dex_register_maps_(allocator), @@ -76,8 +75,6 @@ class StackMapStream : public ValueObject { current_dex_registers_.push_back(DexRegisterLocation(kind, value)); } - void AddInvoke(InvokeType type, uint32_t dex_method_index); - void BeginInlineInfoEntry(ArtMethod* method, uint32_t dex_pc, uint32_t num_dex_registers, @@ -112,7 +109,6 @@ class StackMapStream : public ValueObject { BitTableBuilder<StackMap> stack_maps_; BitTableBuilder<RegisterMask> register_masks_; BitmapTableBuilder stack_masks_; - BitTableBuilder<InvokeInfo> invoke_infos_; BitTableBuilder<InlineInfo> inline_infos_; BitmapTableBuilder dex_register_masks_; BitTableBuilder<MaskInfo> dex_register_maps_; diff --git a/compiler/optimizing/stack_map_test.cc b/compiler/optimizing/stack_map_test.cc index 9ed90a4839..42f978988f 100644 --- a/compiler/optimizing/stack_map_test.cc +++ b/compiler/optimizing/stack_map_test.cc @@ -758,56 +758,4 @@ TEST(StackMapTest, TestDeduplicateStackMask) { stack_map2.GetStackMaskIndex()); } -TEST(StackMapTest, TestInvokeInfo) { - MallocArenaPool pool; - ArenaStack arena_stack(&pool); - ScopedArenaAllocator allocator(&arena_stack); - StackMapStream stream(&allocator, kRuntimeISA); - stream.BeginMethod(32, 0, 0, 0); - - ArenaBitVector sp_mask(&allocator, 0, true); - sp_mask.SetBit(1); - stream.BeginStackMapEntry(0, 4 * kPcAlign, 0x3, &sp_mask); - stream.AddInvoke(kSuper, 1); - stream.EndStackMapEntry(); - stream.BeginStackMapEntry(0, 8 * kPcAlign, 0x3, &sp_mask); - stream.AddInvoke(kStatic, 3); - stream.EndStackMapEntry(); - stream.BeginStackMapEntry(0, 16 * kPcAlign, 0x3, &sp_mask); - stream.AddInvoke(kDirect, 65535); - stream.EndStackMapEntry(); - - stream.EndMethod(); - const size_t code_info_size = stream.PrepareForFillIn(); - MemoryRegion code_info_region(allocator.Alloc(code_info_size, kArenaAllocMisc), code_info_size); - stream.FillInCodeInfo(code_info_region); - - const size_t method_info_size = stream.ComputeMethodInfoSize(); - MemoryRegion method_info_region(allocator.Alloc(method_info_size, kArenaAllocMisc), - method_info_size); - stream.FillInMethodInfo(method_info_region); - - CodeInfo code_info(code_info_region); - MethodInfo method_info(method_info_region.begin()); - ASSERT_EQ(3u, code_info.GetNumberOfStackMaps()); - - InvokeInfo invoke1(code_info.GetInvokeInfoForNativePcOffset(4 * kPcAlign)); - InvokeInfo invoke2(code_info.GetInvokeInfoForNativePcOffset(8 * kPcAlign)); - InvokeInfo invoke3(code_info.GetInvokeInfoForNativePcOffset(16 * kPcAlign)); - InvokeInfo invoke_invalid(code_info.GetInvokeInfoForNativePcOffset(12)); - EXPECT_FALSE(invoke_invalid.IsValid()); // No entry for that index. - EXPECT_TRUE(invoke1.IsValid()); - EXPECT_TRUE(invoke2.IsValid()); - EXPECT_TRUE(invoke3.IsValid()); - EXPECT_EQ(invoke1.GetInvokeType(), kSuper); - EXPECT_EQ(invoke1.GetMethodIndex(method_info), 1u); - EXPECT_EQ(invoke1.GetNativePcOffset(kRuntimeISA), 4u * kPcAlign); - EXPECT_EQ(invoke2.GetInvokeType(), kStatic); - EXPECT_EQ(invoke2.GetMethodIndex(method_info), 3u); - EXPECT_EQ(invoke2.GetNativePcOffset(kRuntimeISA), 8u * kPcAlign); - EXPECT_EQ(invoke3.GetInvokeType(), kDirect); - EXPECT_EQ(invoke3.GetMethodIndex(method_info), 65535u); - EXPECT_EQ(invoke3.GetNativePcOffset(kRuntimeISA), 16u * kPcAlign); -} - } // namespace art |