| Index: runtime/vm/intermediate_language.h
|
| diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
|
| index 6ce7d7542c580ea177bb57b51419f43f40d116fa..b215a687fcbffe0f09c6d29452334b28bdf6e437 100644
|
| --- a/runtime/vm/intermediate_language.h
|
| +++ b/runtime/vm/intermediate_language.h
|
| @@ -667,6 +667,8 @@ class ParallelMoveInstr : public TemplateInstruction<0> {
|
| // branches.
|
| class BlockEntryInstr : public Instruction {
|
| public:
|
| + static const intptr_t kInvalidLoopDepth = -1;
|
| +
|
| virtual BlockEntryInstr* AsBlockEntry() { return this; }
|
|
|
| virtual intptr_t PredecessorCount() const = 0;
|
| @@ -747,12 +749,19 @@ class BlockEntryInstr : public Instruction {
|
| loop_info_ = loop_info;
|
| }
|
|
|
| + intptr_t loop_depth() const { return loop_depth_; }
|
| + void set_loop_depth(intptr_t loop_depth) {
|
| + ASSERT(loop_depth_ == kInvalidLoopDepth);
|
| + ASSERT(loop_depth != kInvalidLoopDepth);
|
| + loop_depth_ = loop_depth;
|
| + }
|
| +
|
| virtual BlockEntryInstr* GetBlock() const {
|
| return const_cast<BlockEntryInstr*>(this);
|
| }
|
|
|
| protected:
|
| - BlockEntryInstr(intptr_t block_id, intptr_t try_index)
|
| + BlockEntryInstr(intptr_t block_id, intptr_t try_index, intptr_t loop_depth)
|
| : block_id_(block_id),
|
| try_index_(try_index),
|
| preorder_number_(-1),
|
| @@ -761,7 +770,8 @@ class BlockEntryInstr : public Instruction {
|
| dominated_blocks_(1),
|
| last_instruction_(NULL),
|
| parallel_move_(NULL),
|
| - loop_info_(NULL) { }
|
| + loop_info_(NULL),
|
| + loop_depth_(loop_depth) { }
|
|
|
| private:
|
| virtual void ClearPredecessors() = 0;
|
| @@ -788,6 +798,9 @@ class BlockEntryInstr : public Instruction {
|
| // preorder number.
|
| BitVector* loop_info_;
|
|
|
| + // Syntactic loop depth of the block.
|
| + intptr_t loop_depth_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(BlockEntryInstr);
|
| };
|
|
|
| @@ -901,8 +914,8 @@ class GraphEntryInstr : public BlockEntryInstr {
|
|
|
| class JoinEntryInstr : public BlockEntryInstr {
|
| public:
|
| - JoinEntryInstr(intptr_t block_id, intptr_t try_index)
|
| - : BlockEntryInstr(block_id, try_index),
|
| + JoinEntryInstr(intptr_t block_id, intptr_t try_index, intptr_t loop_depth)
|
| + : BlockEntryInstr(block_id, try_index, loop_depth),
|
| predecessors_(2), // Two is the assumed to be the common case.
|
| phis_(NULL),
|
| phi_count_(0) { }
|
| @@ -971,8 +984,8 @@ class PhiIterator : public ValueObject {
|
|
|
| class TargetEntryInstr : public BlockEntryInstr {
|
| public:
|
| - TargetEntryInstr(intptr_t block_id, intptr_t try_index)
|
| - : BlockEntryInstr(block_id, try_index),
|
| + TargetEntryInstr(intptr_t block_id, intptr_t try_index, intptr_t loop_depth)
|
| + : BlockEntryInstr(block_id, try_index, loop_depth),
|
| predecessor_(NULL),
|
| catch_try_index_(CatchClauseNode::kInvalidTryIndex) { }
|
|
|
|
|