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

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

Issue 23445012: Mark exception handlers if they have a stacktrace specified. Do not build a stacktrace if the handl… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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') | no next file with comments »
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 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 class CatchClauseNode : public AstNode { 1597 class CatchClauseNode : public AstNode {
1598 public: 1598 public:
1599 static const int kInvalidTryIndex = -1; 1599 static const int kInvalidTryIndex = -1;
1600 1600
1601 CatchClauseNode(intptr_t token_pos, 1601 CatchClauseNode(intptr_t token_pos,
1602 SequenceNode* catch_block, 1602 SequenceNode* catch_block,
1603 const Array& handler_types, 1603 const Array& handler_types,
1604 const LocalVariable* context_var, 1604 const LocalVariable* context_var,
1605 const LocalVariable* exception_var, 1605 const LocalVariable* exception_var,
1606 const LocalVariable* stacktrace_var, 1606 const LocalVariable* stacktrace_var,
1607 intptr_t catch_handler_index) 1607 intptr_t catch_handler_index,
1608 bool needs_stacktrace)
1608 : AstNode(token_pos), 1609 : AstNode(token_pos),
1609 catch_block_(catch_block), 1610 catch_block_(catch_block),
1610 handler_types_(handler_types), 1611 handler_types_(handler_types),
1611 context_var_(*context_var), 1612 context_var_(*context_var),
1612 exception_var_(*exception_var), 1613 exception_var_(*exception_var),
1613 stacktrace_var_(*stacktrace_var), 1614 stacktrace_var_(*stacktrace_var),
1614 catch_handler_index_(catch_handler_index) { 1615 catch_handler_index_(catch_handler_index),
1616 needs_stacktrace_(needs_stacktrace) {
1615 ASSERT(catch_block_ != NULL); 1617 ASSERT(catch_block_ != NULL);
1616 ASSERT(handler_types.IsZoneHandle()); 1618 ASSERT(handler_types.IsZoneHandle());
1617 ASSERT(context_var != NULL); 1619 ASSERT(context_var != NULL);
1618 ASSERT(exception_var != NULL); 1620 ASSERT(exception_var != NULL);
1619 ASSERT(stacktrace_var != NULL); 1621 ASSERT(stacktrace_var != NULL);
1620 } 1622 }
1621 1623
1622 const Array& handler_types() const { return handler_types_; } 1624 const Array& handler_types() const { return handler_types_; }
1623 const LocalVariable& context_var() const { return context_var_; } 1625 const LocalVariable& context_var() const { return context_var_; }
1624 const LocalVariable& exception_var() const { return exception_var_; } 1626 const LocalVariable& exception_var() const { return exception_var_; }
1625 const LocalVariable& stacktrace_var() const { return stacktrace_var_; } 1627 const LocalVariable& stacktrace_var() const { return stacktrace_var_; }
1626 intptr_t catch_handler_index() const { return catch_handler_index_; } 1628 intptr_t catch_handler_index() const { return catch_handler_index_; }
1629 bool needs_stacktrace() const { return needs_stacktrace_; }
1627 1630
1628 virtual void VisitChildren(AstNodeVisitor* visitor) const { 1631 virtual void VisitChildren(AstNodeVisitor* visitor) const {
1629 catch_block_->Visit(visitor); 1632 catch_block_->Visit(visitor);
1630 } 1633 }
1631 1634
1632 DECLARE_COMMON_NODE_FUNCTIONS(CatchClauseNode); 1635 DECLARE_COMMON_NODE_FUNCTIONS(CatchClauseNode);
1633 1636
1634 private: 1637 private:
1635 SequenceNode* catch_block_; 1638 SequenceNode* catch_block_;
1636 const Array& handler_types_; 1639 const Array& handler_types_;
1637 const LocalVariable& context_var_; 1640 const LocalVariable& context_var_;
1638 const LocalVariable& exception_var_; 1641 const LocalVariable& exception_var_;
1639 const LocalVariable& stacktrace_var_; 1642 const LocalVariable& stacktrace_var_;
1640 const intptr_t catch_handler_index_; 1643 const intptr_t catch_handler_index_;
1644 const bool needs_stacktrace_;
1641 1645
1642 DISALLOW_COPY_AND_ASSIGN(CatchClauseNode); 1646 DISALLOW_COPY_AND_ASSIGN(CatchClauseNode);
1643 }; 1647 };
1644 1648
1645 1649
1646 class TryCatchNode : public AstNode { 1650 class TryCatchNode : public AstNode {
1647 public: 1651 public:
1648 TryCatchNode(intptr_t token_pos, 1652 TryCatchNode(intptr_t token_pos,
1649 SequenceNode* try_block, 1653 SequenceNode* try_block,
1650 SourceLabel* end_catch_label, 1654 SourceLabel* end_catch_label,
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 const intptr_t try_index_; 1757 const intptr_t try_index_;
1754 1758
1755 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); 1759 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode);
1756 }; 1760 };
1757 1761
1758 } // namespace dart 1762 } // namespace dart
1759 1763
1760 #undef DECLARE_COMMON_NODE_FUNCTIONS 1764 #undef DECLARE_COMMON_NODE_FUNCTIONS
1761 1765
1762 #endif // VM_AST_H_ 1766 #endif // VM_AST_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_descriptors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698