summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2015-08-18 17:48:17 +0100
committer David Brazdil <dbrazdil@google.com> 2015-08-19 19:55:43 +0100
commitbbd733e4ef277eff19bf9a6601032da081e9b68f (patch)
tree47c5e9624378d8705e8e448ed951617f680d021f /compiler/optimizing/nodes.h
parenta35d4c9d66b372e7ae1014357c48ddfa6104085b (diff)
ART: Enable basic optimizations for try/catch
Generating code for try/catch methods requires having run at least the instruction simplifier to remove redundant suspend checks. This patch enables the first group of optimizations when try/catch is present. Enabled optimizations: 1) IntrinsicsRecognizer Does not modify the graph, only sets HInvoke::intrinsic_. 2) ConstantFolding Does not deal with throwing instructions. 3) InstructionSimplifier May remove a throwing instruction (e.g. LoadClass in VisitCheckCast), or may turn a throwing instruction into a non-throwing one (ArraySet). Their corresponding catch phi inputs are not removed but correctness is preserved. 4) ReferenceTypePropagation Does not modify the graph, only sets type properties. Typing of LoadException from catch handler information was added. 5) DeadCodeElimination Removing individual instructions is fine (same as 3). Removal of dead blocks was disabled for try/catch. Change-Id: I2722c3229eb8aaf326391e07f522dbf5186774b8
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 c4f64b4ebe..c8b22a838e 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -350,6 +350,9 @@ class HGraph : public ArenaObject<kArenaAllocMisc> {
return instruction_set_;
}
+ // TODO: Remove once the full compilation pipeline is enabled for try/catch.
+ bool HasTryCatch() const;
+
private:
void VisitBlockForDominatorTree(HBasicBlock* block,
HBasicBlock* predecessor,
@@ -4471,6 +4474,8 @@ class HLoadException : public HExpression<0> {
public:
HLoadException() : HExpression(Primitive::kPrimNot, SideEffects::None()) {}
+ bool CanBeNull() const OVERRIDE { return false; }
+
DECLARE_INSTRUCTION(LoadException);
private: