Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: runtime/vm/ast.h

Issue 11883023: Collect debugging info for catch clauses (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/code_descriptors.h » ('j') | runtime/vm/object.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_AST_H_ 5 #ifndef VM_AST_H_
6 #define VM_AST_H_ 6 #define VM_AST_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode); 1552 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode);
1553 }; 1553 };
1554 1554
1555 1555
1556 class CatchClauseNode : public AstNode { 1556 class CatchClauseNode : public AstNode {
1557 public: 1557 public:
1558 static const int kInvalidTryIndex = -1; 1558 static const int kInvalidTryIndex = -1;
1559 1559
1560 CatchClauseNode(intptr_t token_pos, 1560 CatchClauseNode(intptr_t token_pos,
1561 SequenceNode* catch_block, 1561 SequenceNode* catch_block,
1562 const Array& handler_types,
1562 const LocalVariable* context_var, 1563 const LocalVariable* context_var,
1563 const LocalVariable* exception_var, 1564 const LocalVariable* exception_var,
1564 const LocalVariable* stacktrace_var) 1565 const LocalVariable* stacktrace_var)
1565 : AstNode(token_pos), 1566 : AstNode(token_pos),
1566 try_index_(kInvalidTryIndex), 1567 try_index_(kInvalidTryIndex),
1567 catch_block_(catch_block), 1568 catch_block_(catch_block),
1569 handler_types_(handler_types),
1568 context_var_(*context_var), 1570 context_var_(*context_var),
1569 exception_var_(*exception_var), 1571 exception_var_(*exception_var),
1570 stacktrace_var_(*stacktrace_var) { 1572 stacktrace_var_(*stacktrace_var) {
1571 ASSERT(catch_block_ != NULL); 1573 ASSERT(catch_block_ != NULL);
1574 ASSERT(handler_types.IsZoneHandle());
1572 ASSERT(context_var != NULL); 1575 ASSERT(context_var != NULL);
1573 ASSERT(exception_var != NULL); 1576 ASSERT(exception_var != NULL);
1574 ASSERT(stacktrace_var != NULL); 1577 ASSERT(stacktrace_var != NULL);
1575 } 1578 }
1576 1579
1577 int try_index() const { 1580 int try_index() const {
1578 ASSERT(try_index_ >= 0); 1581 ASSERT(try_index_ >= 0);
1579 return try_index_; 1582 return try_index_;
1580 } 1583 }
1581 void set_try_index(int value) { try_index_ = value; } 1584 void set_try_index(int value) { try_index_ = value; }
1582 1585
1586 const Array& handler_types() const { return handler_types_; }
1583 const LocalVariable& context_var() const { return context_var_; } 1587 const LocalVariable& context_var() const { return context_var_; }
1584 const LocalVariable& exception_var() const { return exception_var_; } 1588 const LocalVariable& exception_var() const { return exception_var_; }
1585 const LocalVariable& stacktrace_var() const { return stacktrace_var_; } 1589 const LocalVariable& stacktrace_var() const { return stacktrace_var_; }
1586 1590
1587 virtual void VisitChildren(AstNodeVisitor* visitor) const { 1591 virtual void VisitChildren(AstNodeVisitor* visitor) const {
1588 catch_block_->Visit(visitor); 1592 catch_block_->Visit(visitor);
1589 } 1593 }
1590 1594
1591 DECLARE_COMMON_NODE_FUNCTIONS(CatchClauseNode); 1595 DECLARE_COMMON_NODE_FUNCTIONS(CatchClauseNode);
1592 1596
1593 private: 1597 private:
1594 int try_index_; // Running index of the try blocks seen in a function. 1598 int try_index_; // Running index of the try blocks seen in a function.
1595 SequenceNode* catch_block_; 1599 SequenceNode* catch_block_;
1600 const Array& handler_types_;
1596 const LocalVariable& context_var_; 1601 const LocalVariable& context_var_;
1597 const LocalVariable& exception_var_; 1602 const LocalVariable& exception_var_;
1598 const LocalVariable& stacktrace_var_; 1603 const LocalVariable& stacktrace_var_;
1599 1604
1600 DISALLOW_COPY_AND_ASSIGN(CatchClauseNode); 1605 DISALLOW_COPY_AND_ASSIGN(CatchClauseNode);
1601 }; 1606 };
1602 1607
1603 1608
1604 class TryCatchNode : public AstNode { 1609 class TryCatchNode : public AstNode {
1605 public: 1610 public:
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 const LocalVariable& context_var_; 1708 const LocalVariable& context_var_;
1704 1709
1705 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); 1710 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode);
1706 }; 1711 };
1707 1712
1708 } // namespace dart 1713 } // namespace dart
1709 1714
1710 #undef DECLARE_COMMON_NODE_FUNCTIONS 1715 #undef DECLARE_COMMON_NODE_FUNCTIONS
1711 1716
1712 #endif // VM_AST_H_ 1717 #endif // VM_AST_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_descriptors.h » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698