summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_simplifier.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2022-12-05 12:05:43 +0000
committer Santiago Aboy Solanes <solanes@google.com> 2022-12-05 17:26:27 +0000
commit13c3ce1edf7fa9e8e97fb60625a62cb97a13f9a9 (patch)
tree2c4188ec7dbd450d158598527371edbaa3cbd3fa /compiler/optimizing/instruction_simplifier.cc
parent6d2b6bacc6ad5c7e85a8608094469088cd6c8f56 (diff)
Update CanTriggerGC flag for ArraySet
ArraySet instructions can trigger a GC only when perforing a type check. When clearing the needs type check flag, we should also clear the CanTriggerGC flag from the instruction's side effects. Note that once we clear the needs type check flag, we never set it again. Add check in graph checker that the needs type check and the can trigger GC flag are consistent. Add can_trigger_gc property to graph visualizer that reflects whether the ArraySet instruction can trigger a GC. Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I4c74f902aabf2339bd292e9b24737f55d2737440
Diffstat (limited to 'compiler/optimizing/instruction_simplifier.cc')
-rw-r--r--compiler/optimizing/instruction_simplifier.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc
index ac212e07fe..82c1f6d3ff 100644
--- a/compiler/optimizing/instruction_simplifier.cc
+++ b/compiler/optimizing/instruction_simplifier.cc
@@ -1142,13 +1142,13 @@ void InstructionSimplifierVisitor::VisitArraySet(HArraySet* instruction) {
if (value->IsArrayGet()) {
if (value->AsArrayGet()->GetArray() == instruction->GetArray()) {
// If the code is just swapping elements in the array, no need for a type check.
- instruction->ClearNeedsTypeCheck();
+ instruction->ClearTypeCheck();
return;
}
}
if (value->IsNullConstant()) {
- instruction->ClearNeedsTypeCheck();
+ instruction->ClearTypeCheck();
return;
}
@@ -1160,13 +1160,13 @@ void InstructionSimplifierVisitor::VisitArraySet(HArraySet* instruction) {
}
if (value_rti.IsValid() && array_rti.CanArrayHold(value_rti)) {
- instruction->ClearNeedsTypeCheck();
+ instruction->ClearTypeCheck();
return;
}
if (array_rti.IsObjectArray()) {
if (array_rti.IsExact()) {
- instruction->ClearNeedsTypeCheck();
+ instruction->ClearTypeCheck();
return;
}
instruction->SetStaticTypeOfArrayIsObjectArray();