summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2018-04-17 14:56:29 -0700
committer Aart Bik <ajcbik@google.com> 2018-04-18 16:01:35 -0700
commit2905de1c0e5b6a0c995be474b3f0efdfdc6a41c4 (patch)
tree83f372a7922090b3243831c2cb9a23b3ccd29c0b /compiler/optimizing/nodes.h
parent740a50992ea1a200068eb4486a172a151c9b329c (diff)
Deopt does not throw
Rationale: "CanThrow" of deopt was possibly misused to prevents some optimizations. However, the instruction technically cannot throw an exception, and indeed crashed the graph verifier for some corner cases. This Cl sets that right. Bug: 29868356 Test: test-art-host,target Change-Id: Icb551d3b2935282a70ad673a0544e4fe01104da1
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 79d733060b..b315c81693 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -1272,8 +1272,6 @@ class HBasicBlock : public ArenaObject<kArenaAllocBasicBlock> {
// the appropriate try entry will be returned.
const HTryBoundary* ComputeTryEntryOfSuccessors() const;
- bool HasThrowingInstructions() const;
-
// Returns whether this block dominates the blocked passed as parameter.
bool Dominates(HBasicBlock* block) const;
@@ -2132,6 +2130,7 @@ class HInstruction : public ArenaObject<kArenaAllocInstruction> {
!CanThrow() &&
!IsSuspendCheck() &&
!IsControlFlow() &&
+ !IsDeoptimize() &&
!IsNativeDebugInfo() &&
!IsParameterValue() &&
// If we added an explicit barrier then we should keep it.
@@ -3238,7 +3237,9 @@ class HDeoptimize FINAL : public HVariableInputSizeInstruction {
bool NeedsEnvironment() const OVERRIDE { return true; }
- bool CanThrow() const OVERRIDE { return true; }
+ // Even though deoptimize is often used for "exceptional cases" to go back to
+ // the interpreter, it never throws an exception.
+ bool CanThrow() const OVERRIDE { return false; }
DeoptimizationKind GetDeoptimizationKind() const { return GetPackedField<DeoptimizeKindField>(); }