diff options
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
| -rw-r--r-- | compiler/optimizing/instruction_builder.cc | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index 143c77f334..ca3b191cb0 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -28,12 +28,6 @@ namespace art { -void HInstructionBuilder::MaybeRecordStat(MethodCompilationStat compilation_stat) { - if (compilation_stats_ != nullptr) { - compilation_stats_->RecordStat(compilation_stat); - } -} - HBasicBlock* HInstructionBuilder::FindBlockStartingAt(uint32_t dex_pc) const { return block_builder_->GetBlockAt(dex_pc); } @@ -670,6 +664,9 @@ void HInstructionBuilder::BuildReturn(const Instruction& instruction, DCHECK(fence_target != nullptr); AppendInstruction(new (arena_) HConstructorFence(fence_target, dex_pc, arena_)); + MaybeRecordStat( + compilation_stats_, + MethodCompilationStat::kConstructorFenceGeneratedFinal); } AppendInstruction(new (arena_) HReturnVoid(dex_pc)); } else { @@ -816,7 +813,8 @@ bool HInstructionBuilder::BuildInvoke(const Instruction& instruction, ArtMethod* resolved_method = ResolveMethod(method_idx, invoke_type); if (UNLIKELY(resolved_method == nullptr)) { - MaybeRecordStat(MethodCompilationStat::kUnresolvedMethod); + MaybeRecordStat(compilation_stats_, + MethodCompilationStat::kUnresolvedMethod); HInvoke* invoke = new (arena_) HInvokeUnresolved(arena_, number_of_arguments, return_type, @@ -1039,6 +1037,9 @@ void HInstructionBuilder::BuildConstructorFenceForAllocation(HInstruction* alloc HConstructorFence* ctor_fence = new (arena_) HConstructorFence(allocation, allocation->GetDexPc(), arena_); AppendInstruction(ctor_fence); + MaybeRecordStat( + compilation_stats_, + MethodCompilationStat::kConstructorFenceGeneratedNew); } static bool IsSubClass(mirror::Class* to_test, mirror::Class* super_class) @@ -1122,7 +1123,8 @@ bool HInstructionBuilder::SetupInvokeArguments(HInvoke* invoke, VLOG(compiler) << "Did not compile " << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << " because of non-sequential dex register pair in wide argument"; - MaybeRecordStat(MethodCompilationStat::kNotCompiledMalformedOpcode); + MaybeRecordStat(compilation_stats_, + MethodCompilationStat::kNotCompiledMalformedOpcode); return false; } HInstruction* arg = LoadLocal(is_range ? register_index + i : args[i], type); @@ -1136,7 +1138,8 @@ bool HInstructionBuilder::SetupInvokeArguments(HInvoke* invoke, VLOG(compiler) << "Did not compile " << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << " because of wrong number of arguments in invoke instruction"; - MaybeRecordStat(MethodCompilationStat::kNotCompiledMalformedOpcode); + MaybeRecordStat(compilation_stats_, + MethodCompilationStat::kNotCompiledMalformedOpcode); return false; } @@ -1286,7 +1289,8 @@ bool HInstructionBuilder::BuildInstanceFieldAccess(const Instruction& instructio HInstruction* value = LoadLocal(source_or_dest_reg, field_type); HInstruction* field_set = nullptr; if (resolved_field == nullptr) { - MaybeRecordStat(MethodCompilationStat::kUnresolvedField); + MaybeRecordStat(compilation_stats_, + MethodCompilationStat::kUnresolvedField); field_set = new (arena_) HUnresolvedInstanceFieldSet(object, value, field_type, @@ -1309,7 +1313,8 @@ bool HInstructionBuilder::BuildInstanceFieldAccess(const Instruction& instructio } else { HInstruction* field_get = nullptr; if (resolved_field == nullptr) { - MaybeRecordStat(MethodCompilationStat::kUnresolvedField); + MaybeRecordStat(compilation_stats_, + MethodCompilationStat::kUnresolvedField); field_get = new (arena_) HUnresolvedInstanceFieldGet(object, field_type, field_index, @@ -1444,7 +1449,8 @@ bool HInstructionBuilder::BuildStaticFieldAccess(const Instruction& instruction, ArtField* resolved_field = ResolveField(field_index, /* is_static */ true, is_put); if (resolved_field == nullptr) { - MaybeRecordStat(MethodCompilationStat::kUnresolvedField); + MaybeRecordStat(compilation_stats_, + MethodCompilationStat::kUnresolvedField); Primitive::Type field_type = GetFieldAccessType(*dex_file_, field_index); BuildUnresolvedStaticFieldAccess(instruction, dex_pc, is_put, field_type); return true; @@ -1462,7 +1468,8 @@ bool HInstructionBuilder::BuildStaticFieldAccess(const Instruction& instruction, if (constant == nullptr) { // The class cannot be referenced from this compiled code. Generate // an unresolved access. - MaybeRecordStat(MethodCompilationStat::kUnresolvedFieldNotAFastAccess); + MaybeRecordStat(compilation_stats_, + MethodCompilationStat::kUnresolvedFieldNotAFastAccess); BuildUnresolvedStaticFieldAccess(instruction, dex_pc, is_put, field_type); return true; } @@ -2823,7 +2830,8 @@ bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction, << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << " because of unhandled instruction " << instruction.Name(); - MaybeRecordStat(MethodCompilationStat::kNotCompiledUnhandledInstruction); + MaybeRecordStat(compilation_stats_, + MethodCompilationStat::kNotCompiledUnhandledInstruction); return false; } return true; |