diff options
| author | 2015-07-01 13:54:32 +0000 | |
|---|---|---|
| committer | 2015-07-01 13:54:33 +0000 | |
| commit | 8922e0b575742aaabbb4168b8703f7c1a4cb346c (patch) | |
| tree | 90273cf0c055f58b8734603fc9d13193f9c030d2 /compiler/optimizing/nodes.h | |
| parent | 312f1bfcfd8f655e635c941dda147377d8bff814 (diff) | |
| parent | 56e1accf3966ae92e151567abf4561ef3f6466f4 (diff) | |
Merge "ART: Changes to try-catch in GraphBuilder"
Diffstat (limited to 'compiler/optimizing/nodes.h')
| -rw-r--r-- | compiler/optimizing/nodes.h | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 95ea9662e7..5c102453f5 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -729,9 +729,10 @@ class HBasicBlock : public ArenaObject<kArenaAllocMisc> { bool IsExceptionalSuccessor(size_t idx) const; // Split the block into two blocks just before `cursor`. Returns the newly - // created, latter block. Note that this method will create a Goto at the end - // of the former block and will create an edge between them. It will not, - // however, update the graph, reverse post order or loop information. + // created, latter block. Note that this method will add the block to the + // graph, create a Goto at the end of the former block and will create an edge + // between the blocks. It will not, however, update the reverse post order or + // loop information. HBasicBlock* SplitBefore(HInstruction* cursor); // Split the block into two blocks just after `cursor`. Returns the newly @@ -1946,11 +1947,18 @@ class HIf : public HTemplateInstruction<1> { // higher indices in no particular order. class HTryBoundary : public HTemplateInstruction<0> { public: - HTryBoundary(bool is_entry, bool is_exit) - : HTemplateInstruction(SideEffects::None()), is_entry_(is_entry), is_exit_(is_exit) {} + enum BoundaryKind { + kEntry, + kExit, + }; + + explicit HTryBoundary(BoundaryKind kind) + : HTemplateInstruction(SideEffects::None()), kind_(kind) {} bool IsControlFlow() const OVERRIDE { return true; } + bool CanThrow() const OVERRIDE { return true; } + // Returns the block's non-exceptional successor (index zero). HBasicBlock* GetNormalFlowSuccessor() const { return GetBlock()->GetSuccessors().Get(0); } @@ -1977,21 +1985,12 @@ class HTryBoundary : public HTemplateInstruction<0> { } } - bool IsTryEntry() const { return is_entry_; } - bool IsTryExit() const { return is_exit_; } + bool IsEntry() const { return kind_ == BoundaryKind::kEntry; } DECLARE_INSTRUCTION(TryBoundary); private: - // Only for debugging purposes. - bool is_entry_; - bool is_exit_; - - // Only set by HGraphBuilder. - void SetIsTryEntry() { is_entry_ = true; } - void SetIsTryExit() { is_exit_ = true; } - - friend HGraphBuilder; + const BoundaryKind kind_; DISALLOW_COPY_AND_ASSIGN(HTryBoundary); }; |