diff options
author | 2016-01-13 12:09:39 +0000 | |
---|---|---|
committer | 2016-01-13 12:38:52 +0000 | |
commit | 1af564e2d3b560fb9a076eb35ea20471aed0dc92 (patch) | |
tree | 1a369a546a6319fd866c241d5c92f3a241d314af /compiler/optimizing/nodes.h | |
parent | 922698ded1e80cad1ecce4c2172a88c76a216373 (diff) |
Set side effects to HNullCheck and HBoundsCheck.
Both can trigger GC, as they will call NullPointerException or
IndexOutOfBoundsException constructors.
bug:26532563
Change-Id: Id9e42f0450caaaf365630989e1b36e98add46c89
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 9a7dfd8abf..35944ec1ce 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -4530,8 +4530,10 @@ class HPhi : public HInstruction { class HNullCheck : public HExpression<1> { public: + // `HNullCheck` can trigger GC, as it may call the `NullPointerException` + // constructor. HNullCheck(HInstruction* value, uint32_t dex_pc) - : HExpression(value->GetType(), SideEffects::None(), dex_pc) { + : HExpression(value->GetType(), SideEffects::CanTriggerGC(), dex_pc) { SetRawInputAt(0, value); } @@ -4852,8 +4854,10 @@ class HArrayLength : public HExpression<1> { class HBoundsCheck : public HExpression<2> { public: + // `HBoundsCheck` can trigger GC, as it may call the `IndexOutOfBoundsException` + // constructor. HBoundsCheck(HInstruction* index, HInstruction* length, uint32_t dex_pc) - : HExpression(index->GetType(), SideEffects::None(), dex_pc) { + : HExpression(index->GetType(), SideEffects::CanTriggerGC(), dex_pc) { DCHECK(index->GetType() == Primitive::kPrimInt); SetRawInputAt(0, index); SetRawInputAt(1, length); |