summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 3a1864b2ae..8644f676e8 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -1198,11 +1198,14 @@ void HVariableInputSizeInstruction::RemoveAllInputs() {
DCHECK_EQ(0u, InputCount());
}
-void HConstructorFence::RemoveConstructorFences(HInstruction* instruction) {
+size_t HConstructorFence::RemoveConstructorFences(HInstruction* instruction) {
DCHECK(instruction->GetBlock() != nullptr);
// Removing constructor fences only makes sense for instructions with an object return type.
DCHECK_EQ(Primitive::kPrimNot, instruction->GetType());
+ // Return how many instructions were removed for statistic purposes.
+ size_t remove_count = 0;
+
// Efficient implementation that simultaneously (in one pass):
// * Scans the uses list for all constructor fences.
// * Deletes that constructor fence from the uses list of `instruction`.
@@ -1250,6 +1253,7 @@ void HConstructorFence::RemoveConstructorFences(HInstruction* instruction) {
// is removed.
if (ctor_fence->InputCount() == 0u) {
ctor_fence->GetBlock()->RemoveInstruction(ctor_fence);
+ ++remove_count;
}
}
}
@@ -1263,6 +1267,8 @@ void HConstructorFence::RemoveConstructorFences(HInstruction* instruction) {
}
CHECK(instruction->GetBlock() != nullptr);
}
+
+ return remove_count;
}
HInstruction* HConstructorFence::GetAssociatedAllocation() {