summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2014-10-03 12:45:18 +0100
committer Roland Levillain <rpl@google.com> 2014-10-14 14:44:16 +0100
commite161a2a60c0325793f04be42a0f05228955ecfdd (patch)
tree426167496f383ec4343902f01ce0745d4dd1874d /compiler/optimizing/nodes.h
parent3a3fd0f8d3981691aa2331077a8fae5feee08dd1 (diff)
Do not remove NullChecks & BoundsChecks in HDeadCodeElimination.
Removing a NullCheck or a BoundsCheck instruction may change the behavior of a program. Change-Id: Ib2c9beff0cc98c382210e7cc88b1fa9af3c61887
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 677a4f8591..c6eb806904 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -650,6 +650,7 @@ class HInstruction : public ArenaObject {
virtual bool NeedsEnvironment() const { return false; }
virtual bool IsControlFlow() const { return false; }
+ virtual bool CanThrow() const { return false; }
bool HasSideEffects() const { return side_effects_.HasSideEffects(); }
void AddUseAt(HInstruction* user, size_t index) {
@@ -1642,6 +1643,8 @@ class HNullCheck : public HExpression<1> {
virtual bool NeedsEnvironment() const { return true; }
+ virtual bool CanThrow() const { return true; }
+
uint32_t GetDexPc() const { return dex_pc_; }
DECLARE_INSTRUCTION(NullCheck);
@@ -1802,6 +1805,8 @@ class HBoundsCheck : public HExpression<2> {
virtual bool NeedsEnvironment() const { return true; }
+ virtual bool CanThrow() const { return true; }
+
uint32_t GetDexPc() const { return dex_pc_; }
DECLARE_INSTRUCTION(BoundsCheck);