diff options
author | 2021-03-23 08:25:31 +0000 | |
---|---|---|
committer | 2021-03-23 14:50:24 +0000 | |
commit | 4924ea9ad98832f0ec7db841defca82331ee1b13 (patch) | |
tree | 66864c55d26b70d054e339518ec1890cd203e69a /compiler/optimizing | |
parent | 4312f74ccf65a5abbab53c017b3f2b030c89f65a (diff) |
Remove Vdex::GetQuickenedInfoOf and all its users.
Test: test.py
Bug: 170086509
Change-Id: I1e1a4abf71245c0fd37f951c9af85f62feba18ca
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/builder.cc | 6 | ||||
-rw-r--r-- | compiler/optimizing/builder.h | 4 | ||||
-rw-r--r-- | compiler/optimizing/inliner.cc | 3 | ||||
-rw-r--r-- | compiler/optimizing/instruction_builder.cc | 112 | ||||
-rw-r--r-- | compiler/optimizing/instruction_builder.h | 13 | ||||
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 8 |
6 files changed, 35 insertions, 111 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index decc4a815a..3263e9ca3a 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -41,8 +41,7 @@ HGraphBuilder::HGraphBuilder(HGraph* graph, const DexCompilationUnit* dex_compilation_unit, const DexCompilationUnit* outer_compilation_unit, CodeGenerator* code_generator, - OptimizingCompilerStats* compiler_stats, - ArrayRef<const uint8_t> interpreter_metadata) + OptimizingCompilerStats* compiler_stats) : graph_(graph), dex_file_(&graph->GetDexFile()), code_item_accessor_(accessor), @@ -50,7 +49,6 @@ HGraphBuilder::HGraphBuilder(HGraph* graph, outer_compilation_unit_(outer_compilation_unit), code_generator_(code_generator), compilation_stats_(compiler_stats), - interpreter_metadata_(interpreter_metadata), return_type_(DataType::FromShorty(dex_compilation_unit_->GetShorty()[0])) {} HGraphBuilder::HGraphBuilder(HGraph* graph, @@ -124,7 +122,6 @@ GraphAnalysisResult HGraphBuilder::BuildGraph() { dex_compilation_unit_, outer_compilation_unit_, code_generator_, - interpreter_metadata_, compilation_stats_, &local_allocator); @@ -193,7 +190,6 @@ void HGraphBuilder::BuildIntrinsicGraph(ArtMethod* method) { dex_compilation_unit_, outer_compilation_unit_, code_generator_, - interpreter_metadata_, compilation_stats_, &local_allocator); diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h index 8b76dd9106..580769e0f9 100644 --- a/compiler/optimizing/builder.h +++ b/compiler/optimizing/builder.h @@ -38,8 +38,7 @@ class HGraphBuilder : public ValueObject { const DexCompilationUnit* dex_compilation_unit, const DexCompilationUnit* outer_compilation_unit, CodeGenerator* code_generator, - OptimizingCompilerStats* compiler_stats, - ArrayRef<const uint8_t> interpreter_metadata); + OptimizingCompilerStats* compiler_stats); // Only for unit testing. HGraphBuilder(HGraph* graph, @@ -69,7 +68,6 @@ class HGraphBuilder : public ValueObject { CodeGenerator* const code_generator_; OptimizingCompilerStats* const compilation_stats_; - const ArrayRef<const uint8_t> interpreter_metadata_; const DataType::Type return_type_; DISALLOW_COPY_AND_ASSIGN(HGraphBuilder); diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 7dcca75113..04dcdb6793 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -1983,8 +1983,7 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, &dex_compilation_unit, &outer_compilation_unit_, codegen_, - inline_stats_, - resolved_method->GetQuickenedInfo()); + inline_stats_); if (builder.BuildGraph() != kAnalysisSuccess) { LOG_FAIL(stats_, MethodCompilationStat::kNotInlinedCannotBuild) diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index 068d3a964b..146eb1d223 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -35,7 +35,6 @@ #include "mirror/dex_cache.h" #include "oat_file.h" #include "optimizing_compiler_stats.h" -#include "quicken_info.h" #include "reflective_handle_scope-inl.h" #include "scoped_thread_state_change-inl.h" #include "sharpening.h" @@ -91,7 +90,6 @@ HInstructionBuilder::HInstructionBuilder(HGraph* graph, const DexCompilationUnit* dex_compilation_unit, const DexCompilationUnit* outer_compilation_unit, CodeGenerator* code_generator, - ArrayRef<const uint8_t> interpreter_metadata, OptimizingCompilerStats* compiler_stats, ScopedArenaAllocator* local_allocator) : allocator_(graph->GetAllocator()), @@ -104,7 +102,6 @@ HInstructionBuilder::HInstructionBuilder(HGraph* graph, code_generator_(code_generator), dex_compilation_unit_(dex_compilation_unit), outer_compilation_unit_(outer_compilation_unit), - quicken_info_(interpreter_metadata), compilation_stats_(compiler_stats), local_allocator_(local_allocator), locals_for_(local_allocator->Adapter(kArenaAllocGraphBuilder)), @@ -396,11 +393,6 @@ bool HInstructionBuilder::Build() { DCHECK(!IsBlockPopulated(current_block_)); - uint32_t quicken_index = 0; - if (CanDecodeQuickenedInfo()) { - quicken_index = block_builder_->GetQuickenIndex(block_dex_pc); - } - for (const DexInstructionPcPair& pair : code_item_accessor_.InstructionsFrom(block_dex_pc)) { if (current_block_ == nullptr) { // The previous instruction ended this block. @@ -425,16 +417,12 @@ bool HInstructionBuilder::Build() { DCHECK(Thread::Current() == nullptr || !Thread::Current()->IsExceptionPending()) << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << " " << pair.Inst().Name() << "@" << dex_pc; - if (!ProcessDexInstruction(pair.Inst(), dex_pc, quicken_index)) { + if (!ProcessDexInstruction(pair.Inst(), dex_pc)) { return false; } DCHECK(Thread::Current() == nullptr || !Thread::Current()->IsExceptionPending()) << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << " " << pair.Inst().Name() << "@" << dex_pc; - - if (QuickenInfoTable::NeedsIndexForInstruction(&pair.Inst())) { - ++quicken_index; - } } if (current_block_ != nullptr) { @@ -852,9 +840,7 @@ static InvokeType GetInvokeTypeFromOpCode(Instruction::Code opcode) { case Instruction::INVOKE_DIRECT_RANGE: return kDirect; case Instruction::INVOKE_VIRTUAL: - case Instruction::INVOKE_VIRTUAL_QUICK: case Instruction::INVOKE_VIRTUAL_RANGE: - case Instruction::INVOKE_VIRTUAL_RANGE_QUICK: return kVirtual; case Instruction::INVOKE_INTERFACE: case Instruction::INVOKE_INTERFACE_RANGE: @@ -1947,21 +1933,10 @@ static DataType::Type GetFieldAccessType(const DexFile& dex_file, uint16_t field bool HInstructionBuilder::BuildInstanceFieldAccess(const Instruction& instruction, uint32_t dex_pc, - bool is_put, - size_t quicken_index) { + bool is_put) { uint32_t source_or_dest_reg = instruction.VRegA_22c(); uint32_t obj_reg = instruction.VRegB_22c(); - uint16_t field_index; - if (instruction.IsQuickened()) { - if (!CanDecodeQuickenedInfo()) { - VLOG(compiler) << "Not compiled: Could not decode quickened instruction " - << instruction.Opcode(); - return false; - } - field_index = LookupQuickenedInfo(quicken_index); - } else { - field_index = instruction.VRegC_22c(); - } + uint16_t field_index = instruction.VRegC_22c(); ScopedObjectAccess soa(Thread::Current()); ArtField* resolved_field = ResolveField(field_index, /* is_static= */ false, is_put); @@ -2615,18 +2590,7 @@ void HInstructionBuilder::BuildTypeCheck(const Instruction& instruction, } } -bool HInstructionBuilder::CanDecodeQuickenedInfo() const { - return !quicken_info_.IsNull(); -} - -uint16_t HInstructionBuilder::LookupQuickenedInfo(uint32_t quicken_index) { - DCHECK(CanDecodeQuickenedInfo()); - return quicken_info_.GetData(quicken_index); -} - -bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction, - uint32_t dex_pc, - size_t quicken_index) { +bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction, uint32_t dex_pc) { switch (instruction.Opcode()) { case Instruction::CONST_4: { int32_t register_index = instruction.VRegA(); @@ -2777,19 +2741,8 @@ bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction, case Instruction::INVOKE_INTERFACE: case Instruction::INVOKE_STATIC: case Instruction::INVOKE_SUPER: - case Instruction::INVOKE_VIRTUAL: - case Instruction::INVOKE_VIRTUAL_QUICK: { - uint16_t method_idx; - if (instruction.Opcode() == Instruction::INVOKE_VIRTUAL_QUICK) { - if (!CanDecodeQuickenedInfo()) { - VLOG(compiler) << "Not compiled: Could not decode quickened instruction " - << instruction.Opcode(); - return false; - } - method_idx = LookupQuickenedInfo(quicken_index); - } else { - method_idx = instruction.VRegB_35c(); - } + case Instruction::INVOKE_VIRTUAL: { + uint16_t method_idx = instruction.VRegB_35c(); uint32_t args[5]; uint32_t number_of_vreg_arguments = instruction.GetVarArgs(args); VarArgsInstructionOperands operands(args, number_of_vreg_arguments); @@ -2803,19 +2756,8 @@ bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction, case Instruction::INVOKE_INTERFACE_RANGE: case Instruction::INVOKE_STATIC_RANGE: case Instruction::INVOKE_SUPER_RANGE: - case Instruction::INVOKE_VIRTUAL_RANGE: - case Instruction::INVOKE_VIRTUAL_RANGE_QUICK: { - uint16_t method_idx; - if (instruction.Opcode() == Instruction::INVOKE_VIRTUAL_RANGE_QUICK) { - if (!CanDecodeQuickenedInfo()) { - VLOG(compiler) << "Not compiled: Could not decode quickened instruction " - << instruction.Opcode(); - return false; - } - method_idx = LookupQuickenedInfo(quicken_index); - } else { - method_idx = instruction.VRegB_3rc(); - } + case Instruction::INVOKE_VIRTUAL_RANGE: { + uint16_t method_idx = instruction.VRegB_3rc(); RangeInstructionOperands operands(instruction.VRegC(), instruction.VRegA_3rc()); if (!BuildInvoke(instruction, dex_pc, method_idx, operands)) { return false; @@ -3456,40 +3398,26 @@ bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction, break; case Instruction::IGET: - case Instruction::IGET_QUICK: case Instruction::IGET_WIDE: - case Instruction::IGET_WIDE_QUICK: case Instruction::IGET_OBJECT: - case Instruction::IGET_OBJECT_QUICK: case Instruction::IGET_BOOLEAN: - case Instruction::IGET_BOOLEAN_QUICK: case Instruction::IGET_BYTE: - case Instruction::IGET_BYTE_QUICK: case Instruction::IGET_CHAR: - case Instruction::IGET_CHAR_QUICK: - case Instruction::IGET_SHORT: - case Instruction::IGET_SHORT_QUICK: { - if (!BuildInstanceFieldAccess(instruction, dex_pc, /* is_put= */ false, quicken_index)) { + case Instruction::IGET_SHORT: { + if (!BuildInstanceFieldAccess(instruction, dex_pc, /* is_put= */ false)) { return false; } break; } case Instruction::IPUT: - case Instruction::IPUT_QUICK: case Instruction::IPUT_WIDE: - case Instruction::IPUT_WIDE_QUICK: case Instruction::IPUT_OBJECT: - case Instruction::IPUT_OBJECT_QUICK: case Instruction::IPUT_BOOLEAN: - case Instruction::IPUT_BOOLEAN_QUICK: case Instruction::IPUT_BYTE: - case Instruction::IPUT_BYTE_QUICK: case Instruction::IPUT_CHAR: - case Instruction::IPUT_CHAR_QUICK: - case Instruction::IPUT_SHORT: - case Instruction::IPUT_SHORT_QUICK: { - if (!BuildInstanceFieldAccess(instruction, dex_pc, /* is_put= */ true, quicken_index)) { + case Instruction::IPUT_SHORT: { + if (!BuildInstanceFieldAccess(instruction, dex_pc, /* is_put= */ true)) { return false; } break; @@ -3632,6 +3560,22 @@ bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction, break; } + case Instruction::IGET_QUICK: + case Instruction::IGET_BOOLEAN_QUICK: + case Instruction::IGET_BYTE_QUICK: + case Instruction::IGET_SHORT_QUICK: + case Instruction::IGET_CHAR_QUICK: + case Instruction::IGET_WIDE_QUICK: + case Instruction::IGET_OBJECT_QUICK: + case Instruction::IPUT_QUICK: + case Instruction::IPUT_BOOLEAN_QUICK: + case Instruction::IPUT_BYTE_QUICK: + case Instruction::IPUT_SHORT_QUICK: + case Instruction::IPUT_CHAR_QUICK: + case Instruction::IPUT_WIDE_QUICK: + case Instruction::IPUT_OBJECT_QUICK: + case Instruction::INVOKE_VIRTUAL_QUICK: + case Instruction::INVOKE_VIRTUAL_RANGE_QUICK: case Instruction::UNUSED_3E: case Instruction::UNUSED_3F: case Instruction::UNUSED_40: diff --git a/compiler/optimizing/instruction_builder.h b/compiler/optimizing/instruction_builder.h index 52d4bfcb1e..817fbaa9e8 100644 --- a/compiler/optimizing/instruction_builder.h +++ b/compiler/optimizing/instruction_builder.h @@ -26,7 +26,6 @@ #include "dex/dex_file_types.h" #include "handle.h" #include "nodes.h" -#include "quicken_info.h" namespace art { @@ -58,7 +57,6 @@ class HInstructionBuilder : public ValueObject { const DexCompilationUnit* dex_compilation_unit, const DexCompilationUnit* outer_compilation_unit, CodeGenerator* code_generator, - ArrayRef<const uint8_t> interpreter_metadata, OptimizingCompilerStats* compiler_stats, ScopedArenaAllocator* local_allocator); @@ -70,12 +68,9 @@ class HInstructionBuilder : public ValueObject { void PropagateLocalsToCatchBlocks(); void SetLoopHeaderPhiInputs(); - bool ProcessDexInstruction(const Instruction& instruction, uint32_t dex_pc, size_t quicken_index); + bool ProcessDexInstruction(const Instruction& instruction, uint32_t dex_pc); ArenaBitVector* FindNativeDebugInfoLocations(); - bool CanDecodeQuickenedInfo() const; - uint16_t LookupQuickenedInfo(uint32_t quicken_index); - HBasicBlock* FindBlockStartingAt(uint32_t dex_pc) const; ScopedArenaVector<HInstruction*>* GetLocalsFor(HBasicBlock* block); @@ -141,8 +136,7 @@ class HInstructionBuilder : public ValueObject { // Builds an instance field access node and returns whether the instruction is supported. bool BuildInstanceFieldAccess(const Instruction& instruction, uint32_t dex_pc, - bool is_put, - size_t quicken_index); + bool is_put); void BuildUnresolvedStaticFieldAccess(const Instruction& instruction, uint32_t dex_pc, @@ -325,9 +319,6 @@ class HInstructionBuilder : public ValueObject { // methods. const DexCompilationUnit* const outer_compilation_unit_; - // Original values kept after instruction quickening. - QuickenInfoTable quicken_info_; - OptimizingCompilerStats* const compilation_stats_; ScopedArenaAllocator* const local_allocator_; diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index bf99a0e5ac..b6ab9fb1b5 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -784,7 +784,6 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator, CodeItemDebugInfoAccessor code_item_accessor(dex_file, code_item, method_idx); bool dead_reference_safe; - ArrayRef<const uint8_t> interpreter_metadata; // For AOT compilation, we may not get a method, for example if its class is erroneous, // possibly due to an unavailable superclass. JIT should always have a method. DCHECK(Runtime::Current()->IsAotCompiler() || method != nullptr); @@ -793,7 +792,6 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator, { ScopedObjectAccess soa(Thread::Current()); containing_class = &method->GetClassDef(); - interpreter_metadata = method->GetQuickenedInfo(); } // MethodContainsRSensitiveAccess is currently slow, but HasDeadReferenceSafeAnnotation() // is currently rarely true. @@ -845,8 +843,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator, &dex_compilation_unit, &dex_compilation_unit, codegen.get(), - compilation_stats_.get(), - interpreter_metadata); + compilation_stats_.get()); GraphAnalysisResult result = builder.BuildGraph(); if (result != kAnalysisSuccess) { switch (result) { @@ -970,8 +967,7 @@ CodeGenerator* OptimizingCompiler::TryCompileIntrinsic( &dex_compilation_unit, &dex_compilation_unit, codegen.get(), - compilation_stats_.get(), - /* interpreter_metadata= */ ArrayRef<const uint8_t>()); + compilation_stats_.get()); builder.BuildIntrinsicGraph(method); } |