From 13c3ce1edf7fa9e8e97fb60625a62cb97a13f9a9 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Mon, 5 Dec 2022 12:05:43 +0000 Subject: 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 --- compiler/optimizing/nodes.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 17ede39d1e..006ccfb8ec 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -6597,8 +6597,10 @@ class HArraySet final : public HExpression<3> { return false; } - void ClearNeedsTypeCheck() { + void ClearTypeCheck() { SetPackedFlag(false); + // Clear the `CanTriggerGC` flag too as we can only trigger a GC when doing a type check. + SetSideEffects(GetSideEffects().Exclusion(SideEffects::CanTriggerGC())); } void ClearValueCanBeNull() { -- cgit v1.2.3-59-g8ed1b