diff options
author | 2016-10-19 16:18:50 +0000 | |
---|---|---|
committer | 2016-10-19 16:18:51 +0000 | |
commit | c89f9776a107ca20d0146c16fa881db91c4f8266 (patch) | |
tree | f77bd4525e69c4874c52183878ae642fd5a2201c /compiler/optimizing | |
parent | 58b99c78d0bba093fddebab0dcad45bbcf5c55d9 (diff) | |
parent | 709b070044354d9f47641f273edacaeeb0240ab7 (diff) |
Merge "Remove mirror:: and ArtMethod deps in utils.{h,cc}"
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/builder.cc | 4 | ||||
-rw-r--r-- | compiler/optimizing/graph_visualizer.cc | 15 | ||||
-rw-r--r-- | compiler/optimizing/inliner.cc | 67 | ||||
-rw-r--r-- | compiler/optimizing/instruction_builder.cc | 6 | ||||
-rw-r--r-- | compiler/optimizing/intrinsics.cc | 2 | ||||
-rw-r--r-- | compiler/optimizing/nodes.cc | 2 | ||||
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 8 | ||||
-rw-r--r-- | compiler/optimizing/prepare_for_register_allocation.cc | 2 | ||||
-rw-r--r-- | compiler/optimizing/reference_type_propagation.cc | 4 |
9 files changed, 56 insertions, 54 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 86742e6526..2927e1f7c0 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -51,7 +51,7 @@ bool HGraphBuilder::SkipCompilation(size_t number_of_branches) { if (compiler_options.IsHugeMethod(code_item_.insns_size_in_code_units_)) { VLOG(compiler) << "Skip compilation of huge method " - << PrettyMethod(dex_compilation_unit_->GetDexMethodIndex(), *dex_file_) + << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << ": " << code_item_.insns_size_in_code_units_ << " code units"; MaybeRecordStat(MethodCompilationStat::kNotCompiledHugeMethod); return true; @@ -61,7 +61,7 @@ bool HGraphBuilder::SkipCompilation(size_t number_of_branches) { if (compiler_options.IsLargeMethod(code_item_.insns_size_in_code_units_) && (number_of_branches == 0)) { VLOG(compiler) << "Skip compilation of large method with no branch " - << PrettyMethod(dex_compilation_unit_->GetDexMethodIndex(), *dex_file_) + << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << ": " << code_item_.insns_size_in_code_units_ << " code units"; MaybeRecordStat(MethodCompilationStat::kNotCompiledLargeMethodNoBranches); return true; diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index 912ee29cdb..09dcefa02c 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -441,8 +441,8 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { void VisitInvoke(HInvoke* invoke) OVERRIDE { StartAttributeStream("dex_file_index") << invoke->GetDexMethodIndex(); - StartAttributeStream("method_name") << PrettyMethod( - invoke->GetDexMethodIndex(), GetGraph()->GetDexFile(), /* with_signature */ false); + StartAttributeStream("method_name") << GetGraph()->GetDexFile().PrettyMethod( + invoke->GetDexMethodIndex(), /* with_signature */ false); } void VisitInvokeUnresolved(HInvokeUnresolved* invoke) OVERRIDE { @@ -465,15 +465,15 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { } void VisitInstanceFieldGet(HInstanceFieldGet* iget) OVERRIDE { - StartAttributeStream("field_name") << PrettyField(iget->GetFieldInfo().GetFieldIndex(), - iget->GetFieldInfo().GetDexFile(), + StartAttributeStream("field_name") << + iget->GetFieldInfo().GetDexFile().PrettyField(iget->GetFieldInfo().GetFieldIndex(), /* with type */ false); StartAttributeStream("field_type") << iget->GetFieldType(); } void VisitInstanceFieldSet(HInstanceFieldSet* iset) OVERRIDE { - StartAttributeStream("field_name") << PrettyField(iset->GetFieldInfo().GetFieldIndex(), - iset->GetFieldInfo().GetDexFile(), + StartAttributeStream("field_name") << + iset->GetFieldInfo().GetDexFile().PrettyField(iset->GetFieldInfo().GetFieldIndex(), /* with type */ false); StartAttributeStream("field_type") << iset->GetFieldType(); } @@ -604,7 +604,8 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { : instruction->GetReferenceTypeInfo(); ScopedObjectAccess soa(Thread::Current()); if (info.IsValid()) { - StartAttributeStream("klass") << PrettyDescriptor(info.GetTypeHandle().Get()); + StartAttributeStream("klass") + << mirror::Class::PrettyDescriptor(info.GetTypeHandle().Get()); StartAttributeStream("can_be_null") << std::boolalpha << instruction->CanBeNull() << std::noboolalpha; StartAttributeStream("exact") << std::boolalpha << info.IsExact() << std::noboolalpha; diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 6080551900..9faa98a388 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -90,14 +90,14 @@ void HInliner::Run() { if (!TryInline(call)) { if (kIsDebugBuild && IsCompilingWithCoreImage()) { std::string callee_name = - PrettyMethod(call->GetDexMethodIndex(), *outer_compilation_unit_.GetDexFile()); + outer_compilation_unit_.GetDexFile()->PrettyMethod(call->GetDexMethodIndex()); bool should_inline = callee_name.find("$inline$") != std::string::npos; CHECK(!should_inline) << "Could not inline " << callee_name; } } else { if (kIsDebugBuild && IsCompilingWithCoreImage()) { std::string callee_name = - PrettyMethod(call->GetDexMethodIndex(), *outer_compilation_unit_.GetDexFile()); + outer_compilation_unit_.GetDexFile()->PrettyMethod(call->GetDexMethodIndex()); bool must_not_inline = callee_name.find("$noinline$") != std::string::npos; CHECK(!must_not_inline) << "Should not have inlined " << callee_name; } @@ -203,10 +203,10 @@ static uint32_t FindClassIndexIn(mirror::Class* cls, REQUIRES_SHARED(Locks::mutator_lock_) { uint32_t index = DexFile::kDexNoIndex; if (cls->GetDexCache() == nullptr) { - DCHECK(cls->IsArrayClass()) << PrettyClass(cls); + DCHECK(cls->IsArrayClass()) << cls->PrettyClass(); index = cls->FindTypeIndexInOtherDexFile(dex_file); } else if (cls->GetDexTypeIndex() == DexFile::kDexNoIndex16) { - DCHECK(cls->IsProxyClass()) << PrettyClass(cls); + DCHECK(cls->IsProxyClass()) << cls->PrettyClass(); // TODO: deal with proxy classes. } else if (IsSameDexFile(cls->GetDexFile(), dex_file)) { DCHECK_EQ(cls->GetDexCache(), dex_cache.Get()); @@ -266,7 +266,7 @@ bool HInliner::TryInline(HInvoke* invoke_instruction) { ScopedObjectAccess soa(Thread::Current()); uint32_t method_index = invoke_instruction->GetDexMethodIndex(); const DexFile& caller_dex_file = *caller_compilation_unit_.GetDexFile(); - VLOG(compiler) << "Try inlining " << PrettyMethod(method_index, caller_dex_file); + VLOG(compiler) << "Try inlining " << caller_dex_file.PrettyMethod(method_index); // We can query the dex cache directly. The verifier has populated it already. ArtMethod* resolved_method = invoke_instruction->GetResolvedMethod(); @@ -304,7 +304,7 @@ bool HInliner::TryInline(HInvoke* invoke_instruction) { const InlineCache& ic = *profiling_info->GetInlineCache(invoke_instruction->GetDexPc()); if (ic.IsUninitialized()) { VLOG(compiler) << "Interface or virtual call to " - << PrettyMethod(method_index, caller_dex_file) + << caller_dex_file.PrettyMethod(method_index) << " is not hit and not inlined"; return false; } else if (ic.IsMonomorphic()) { @@ -322,7 +322,7 @@ bool HInliner::TryInline(HInvoke* invoke_instruction) { } else { DCHECK(ic.IsMegamorphic()); VLOG(compiler) << "Interface or virtual call to " - << PrettyMethod(method_index, caller_dex_file) + << caller_dex_file.PrettyMethod(method_index) << " is megamorphic and not inlined"; MaybeRecordStat(kMegamorphicCall); return false; @@ -331,7 +331,7 @@ bool HInliner::TryInline(HInvoke* invoke_instruction) { } VLOG(compiler) << "Interface or virtual call to " - << PrettyMethod(method_index, caller_dex_file) + << caller_dex_file.PrettyMethod(method_index) << " could not be statically determined"; return false; } @@ -366,7 +366,7 @@ bool HInliner::TryInlineMonomorphicCall(HInvoke* invoke_instruction, uint32_t class_index = FindClassIndexIn( ic.GetMonomorphicType(), caller_dex_file, caller_compilation_unit_.GetDexCache()); if (class_index == DexFile::kDexNoIndex) { - VLOG(compiler) << "Call to " << PrettyMethod(resolved_method) + VLOG(compiler) << "Call to " << ArtMethod::PrettyMethod(resolved_method) << " from inline cache is not inlined because its class is not" << " accessible to the caller"; return false; @@ -526,7 +526,7 @@ bool HInliner::TryInlinePolymorphicCall(HInvoke* invoke_instruction, } if (!one_target_inlined) { - VLOG(compiler) << "Call to " << PrettyMethod(resolved_method) + VLOG(compiler) << "Call to " << ArtMethod::PrettyMethod(resolved_method) << " from inline cache is not inlined because none" << " of its targets could be inlined"; return false; @@ -660,7 +660,7 @@ bool HInliner::TryInlinePolymorphicCallToSameTarget(HInvoke* invoke_instruction, actual_method = new_method; } else if (actual_method != new_method) { // Different methods, bailout. - VLOG(compiler) << "Call to " << PrettyMethod(resolved_method) + VLOG(compiler) << "Call to " << ArtMethod::PrettyMethod(resolved_method) << " from inline cache is not inlined because it resolves" << " to different methods"; return false; @@ -794,7 +794,7 @@ bool HInliner::TryBuildAndInline(HInvoke* invoke_instruction, ArtMethod* method, HInstruction** return_replacement) { if (method->IsProxyMethod()) { - VLOG(compiler) << "Method " << PrettyMethod(method) + VLOG(compiler) << "Method " << method->PrettyMethod() << " is not inlined because of unimplemented inline support for proxy methods."; return false; } @@ -804,11 +804,12 @@ bool HInliner::TryBuildAndInline(HInvoke* invoke_instruction, if (!compiler_driver_->MayInline(method->GetDexFile(), outer_compilation_unit_.GetDexFile())) { if (TryPatternSubstitution(invoke_instruction, method, return_replacement)) { - VLOG(compiler) << "Successfully replaced pattern of invoke " << PrettyMethod(method); + VLOG(compiler) << "Successfully replaced pattern of invoke " + << method->PrettyMethod(); MaybeRecordStat(kReplacedInvokeWithSimplePattern); return true; } - VLOG(compiler) << "Won't inline " << PrettyMethod(method) << " in " + VLOG(compiler) << "Won't inline " << method->PrettyMethod() << " in " << outer_compilation_unit_.GetDexFile()->GetLocation() << " (" << caller_compilation_unit_.GetDexFile()->GetLocation() << ") from " << method->GetDexFile()->GetLocation(); @@ -820,14 +821,14 @@ bool HInliner::TryBuildAndInline(HInvoke* invoke_instruction, const DexFile::CodeItem* code_item = method->GetCodeItem(); if (code_item == nullptr) { - VLOG(compiler) << "Method " << PrettyMethod(method) + VLOG(compiler) << "Method " << method->PrettyMethod() << " is not inlined because it is native"; return false; } size_t inline_max_code_units = compiler_driver_->GetCompilerOptions().GetInlineMaxCodeUnits(); if (code_item->insns_size_in_code_units_ > inline_max_code_units) { - VLOG(compiler) << "Method " << PrettyMethod(method) + VLOG(compiler) << "Method " << method->PrettyMethod() << " is too big to inline: " << code_item->insns_size_in_code_units_ << " > " @@ -836,13 +837,13 @@ bool HInliner::TryBuildAndInline(HInvoke* invoke_instruction, } if (code_item->tries_size_ != 0) { - VLOG(compiler) << "Method " << PrettyMethod(method) + VLOG(compiler) << "Method " << method->PrettyMethod() << " is not inlined because of try block"; return false; } if (!method->IsCompilable()) { - VLOG(compiler) << "Method " << PrettyMethod(method) + VLOG(compiler) << "Method " << method->PrettyMethod() << " has soft failures un-handled by the compiler, so it cannot be inlined"; } @@ -851,7 +852,7 @@ bool HInliner::TryBuildAndInline(HInvoke* invoke_instruction, if (Runtime::Current()->UseJitCompilation() || !compiler_driver_->IsMethodVerifiedWithoutFailures( method->GetDexMethodIndex(), class_def_idx, *method->GetDexFile())) { - VLOG(compiler) << "Method " << PrettyMethod(method) + VLOG(compiler) << "Method " << method->PrettyMethod() << " couldn't be verified, so it cannot be inlined"; return false; } @@ -861,7 +862,7 @@ bool HInliner::TryBuildAndInline(HInvoke* invoke_instruction, invoke_instruction->AsInvokeStaticOrDirect()->IsStaticWithImplicitClinitCheck()) { // Case of a static method that cannot be inlined because it implicitly // requires an initialization check of its declaring class. - VLOG(compiler) << "Method " << PrettyMethod(method) + VLOG(compiler) << "Method " << method->PrettyMethod() << " is not inlined because it is static and requires a clinit" << " check that cannot be emitted due to Dex cache limitations"; return false; @@ -871,7 +872,7 @@ bool HInliner::TryBuildAndInline(HInvoke* invoke_instruction, return false; } - VLOG(compiler) << "Successfully inlined " << PrettyMethod(method); + VLOG(compiler) << "Successfully inlined " << method->PrettyMethod(); MaybeRecordStat(kInlinedInvoke); return true; } @@ -1143,14 +1144,14 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, handles_); if (builder.BuildGraph() != kAnalysisSuccess) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " could not be built, so cannot be inlined"; return false; } if (!RegisterAllocator::CanAllocateRegistersFor(*callee_graph, compiler_driver_->GetInstructionSet())) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " cannot be inlined because of the register allocator"; return false; } @@ -1200,7 +1201,7 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, // a throw predecessor. HBasicBlock* exit_block = callee_graph->GetExitBlock(); if (exit_block == nullptr) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " could not be inlined because it has an infinite loop"; return false; } @@ -1213,7 +1214,7 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, } } if (has_throw_predecessor) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " could not be inlined because one branch always throws"; return false; } @@ -1231,7 +1232,7 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, if (block->IsLoopHeader() && block->GetLoopInformation()->IsIrreducible()) { // Don't inline methods with irreducible loops, they could prevent some // optimizations to run. - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " could not be inlined because it contains an irreducible loop"; return false; } @@ -1240,28 +1241,28 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, !instr_it.Done(); instr_it.Advance()) { if (number_of_instructions++ == number_of_instructions_budget) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " is not inlined because its caller has reached" << " its instruction budget limit."; return false; } HInstruction* current = instr_it.Current(); if (!can_inline_environment && current->NeedsEnvironment()) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " is not inlined because its caller has reached" << " its environment budget limit."; return false; } if (!same_dex_file && current->NeedsEnvironment()) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " could not be inlined because " << current->DebugName() << " needs an environment and is in a different dex file"; return false; } if (!same_dex_file && current->NeedsDexCacheOfDeclaringClass()) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " could not be inlined because " << current->DebugName() << " it is in a different dex file and requires access to the dex cache"; return false; @@ -1269,7 +1270,7 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, if (current->IsNewInstance() && (current->AsNewInstance()->GetEntrypoint() == kQuickAllocObjectWithAccessCheck)) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " could not be inlined because it is using an entrypoint" << " with access checks"; // Allocation entrypoint does not handle inlined frames. @@ -1278,7 +1279,7 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, if (current->IsNewArray() && (current->AsNewArray()->GetEntrypoint() == kQuickAllocArrayWithAccessCheck)) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " could not be inlined because it is using an entrypoint" << " with access checks"; // Allocation entrypoint does not handle inlined frames. @@ -1290,7 +1291,7 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, current->IsUnresolvedStaticFieldSet() || current->IsUnresolvedInstanceFieldSet()) { // Entrypoint for unresolved fields does not handle inlined frames. - VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) + VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index) << " could not be inlined because it is using an unresolved" << " entrypoint"; return false; diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index f7d67db5b2..613e00843f 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -1065,7 +1065,7 @@ bool HInstructionBuilder::SetupInvokeArguments(HInvoke* invoke, // reject any class where this is violated. However, the verifier only does these checks // on non trivially dead instructions, so we just bailout the compilation. VLOG(compiler) << "Did not compile " - << PrettyMethod(dex_compilation_unit_->GetDexMethodIndex(), *dex_file_) + << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << " because of non-sequential dex register pair in wide argument"; MaybeRecordStat(MethodCompilationStat::kNotCompiledMalformedOpcode); return false; @@ -1079,7 +1079,7 @@ bool HInstructionBuilder::SetupInvokeArguments(HInvoke* invoke, if (*argument_index != invoke->GetNumberOfArguments()) { VLOG(compiler) << "Did not compile " - << PrettyMethod(dex_compilation_unit_->GetDexMethodIndex(), *dex_file_) + << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << " because of wrong number of arguments in invoke instruction"; MaybeRecordStat(MethodCompilationStat::kNotCompiledMalformedOpcode); return false; @@ -2716,7 +2716,7 @@ bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction, default: VLOG(compiler) << "Did not compile " - << PrettyMethod(dex_compilation_unit_->GetDexMethodIndex(), *dex_file_) + << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << " because of unhandled instruction " << instruction.Name(); MaybeRecordStat(MethodCompilationStat::kNotCompiledUnhandledInstruction); diff --git a/compiler/optimizing/intrinsics.cc b/compiler/optimizing/intrinsics.cc index 412ccfcf4f..8327a4c244 100644 --- a/compiler/optimizing/intrinsics.cc +++ b/compiler/optimizing/intrinsics.cc @@ -146,7 +146,7 @@ void IntrinsicsRecognizer::Run() { if (!CheckInvokeType(intrinsic, invoke)) { LOG(WARNING) << "Found an intrinsic with unexpected invoke type: " << intrinsic << " for " - << PrettyMethod(invoke->GetDexMethodIndex(), invoke->GetDexFile()) + << invoke->GetDexFile().PrettyMethod(invoke->GetDexMethodIndex()) << invoke->DebugName(); } else { invoke->SetIntrinsic(intrinsic, diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 1e69966b98..59cc0091bf 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -2295,7 +2295,7 @@ std::ostream& operator<<(std::ostream& os, const ReferenceTypeInfo& rhs) { ScopedObjectAccess soa(Thread::Current()); os << "[" << " is_valid=" << rhs.IsValid() - << " type=" << (!rhs.IsValid() ? "?" : PrettyClass(rhs.GetTypeHandle().Get())) + << " type=" << (!rhs.IsValid() ? "?" : mirror::Class::PrettyClass(rhs.GetTypeHandle().Get())) << " is_exact=" << rhs.IsExact() << " ]"; return os; diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 4370a84bd2..6ba0963720 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -173,7 +173,7 @@ class PassObserver : public ValueObject { const char* GetMethodName() { // PrettyMethod() is expensive, so we delay calling it until we actually have to. if (cached_method_name_.empty()) { - cached_method_name_ = PrettyMethod(graph_->GetMethodIdx(), graph_->GetDexFile()); + cached_method_name_ = graph_->GetDexFile().PrettyMethod(graph_->GetMethodIdx()); } return cached_method_name_.c_str(); } @@ -1044,7 +1044,7 @@ CompiledMethod* OptimizingCompiler::Compile(const DexFile::CodeItem* code_item, if (kArenaAllocatorCountAllocations) { if (arena.BytesAllocated() > kArenaAllocatorMemoryReportThreshold) { MemStats mem_stats(arena.GetMemStats()); - LOG(INFO) << PrettyMethod(method_idx, dex_file) << " " << Dumpable<MemStats>(mem_stats); + LOG(INFO) << dex_file.PrettyMethod(method_idx) << " " << Dumpable<MemStats>(mem_stats); } } } @@ -1066,7 +1066,7 @@ CompiledMethod* OptimizingCompiler::Compile(const DexFile::CodeItem* code_item, // instruction set is supported -- and has support for read // barriers, if they are enabled). This makes sure we're not // regressing. - std::string method_name = PrettyMethod(method_idx, dex_file); + std::string method_name = dex_file.PrettyMethod(method_idx); bool shouldCompile = method_name.find("$opt$") != std::string::npos; DCHECK((method != nullptr) || !shouldCompile) << "Didn't compile " << method_name; } @@ -1131,7 +1131,7 @@ bool OptimizingCompiler::JitCompile(Thread* self, if (kArenaAllocatorCountAllocations) { if (arena.BytesAllocated() > kArenaAllocatorMemoryReportThreshold) { MemStats mem_stats(arena.GetMemStats()); - LOG(INFO) << PrettyMethod(method_idx, *dex_file) << " " << Dumpable<MemStats>(mem_stats); + LOG(INFO) << dex_file->PrettyMethod(method_idx) << " " << Dumpable<MemStats>(mem_stats); } } } diff --git a/compiler/optimizing/prepare_for_register_allocation.cc b/compiler/optimizing/prepare_for_register_allocation.cc index 8fb539661f..a4df9e5503 100644 --- a/compiler/optimizing/prepare_for_register_allocation.cc +++ b/compiler/optimizing/prepare_for_register_allocation.cc @@ -44,7 +44,7 @@ void PrepareForRegisterAllocation::VisitBoundsCheck(HBoundsCheck* check) { // Add a fake environment for String.charAt() inline info as we want // the exception to appear as being thrown from there. const DexFile& dex_file = check->GetEnvironment()->GetDexFile(); - DCHECK_STREQ(PrettyMethod(check->GetStringCharAtMethodIndex(), dex_file).c_str(), + DCHECK_STREQ(dex_file.PrettyMethod(check->GetStringCharAtMethodIndex()).c_str(), "char java.lang.String.charAt(int)"); ArenaAllocator* arena = GetGraph()->GetArena(); HEnvironment* environment = new (arena) HEnvironment(arena, diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc index 83698adba4..b16c3eaac7 100644 --- a/compiler/optimizing/reference_type_propagation.cc +++ b/compiler/optimizing/reference_type_propagation.cc @@ -448,9 +448,9 @@ void ReferenceTypePropagation::RTPVisitor::SetClassAsTypeInfo(HInstruction* inst mirror::Class* declaring_class = method->GetDeclaringClass(); DCHECK(declaring_class != nullptr); DCHECK(declaring_class->IsStringClass()) - << "Expected String class: " << PrettyDescriptor(declaring_class); + << "Expected String class: " << declaring_class->PrettyDescriptor(); DCHECK(method->IsConstructor()) - << "Expected String.<init>: " << PrettyMethod(method); + << "Expected String.<init>: " << method->PrettyMethod(); } instr->SetReferenceTypeInfo( ReferenceTypeInfo::Create(handle_cache_->GetStringClassHandle(), /* is_exact */ true)); |