OLD | NEW |
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 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1914 }; | 1914 }; |
1915 | 1915 |
1916 | 1916 |
1917 class TryCatchNode : public AstNode { | 1917 class TryCatchNode : public AstNode { |
1918 public: | 1918 public: |
1919 TryCatchNode(intptr_t token_pos, | 1919 TryCatchNode(intptr_t token_pos, |
1920 SequenceNode* try_block, | 1920 SequenceNode* try_block, |
1921 const LocalVariable* context_var, | 1921 const LocalVariable* context_var, |
1922 CatchClauseNode* catch_block, | 1922 CatchClauseNode* catch_block, |
1923 SequenceNode* finally_block, | 1923 SequenceNode* finally_block, |
1924 intptr_t try_index) | 1924 intptr_t try_index, |
| 1925 SequenceNode* rethrow_clause) |
1925 : AstNode(token_pos), | 1926 : AstNode(token_pos), |
1926 try_block_(try_block), | 1927 try_block_(try_block), |
1927 context_var_(*context_var), | 1928 context_var_(*context_var), |
1928 catch_block_(catch_block), | 1929 catch_block_(catch_block), |
1929 finally_block_(finally_block), | 1930 finally_block_(finally_block), |
1930 try_index_(try_index) { | 1931 try_index_(try_index), |
| 1932 rethrow_clause_(rethrow_clause) { |
1931 ASSERT(try_block_ != NULL); | 1933 ASSERT(try_block_ != NULL); |
1932 ASSERT(context_var != NULL); | 1934 ASSERT(context_var != NULL); |
1933 ASSERT(catch_block_ != NULL); | 1935 ASSERT(catch_block_ != NULL); |
1934 } | 1936 } |
1935 | 1937 |
1936 SequenceNode* try_block() const { return try_block_; } | 1938 SequenceNode* try_block() const { return try_block_; } |
1937 CatchClauseNode* catch_block() const { return catch_block_; } | 1939 CatchClauseNode* catch_block() const { return catch_block_; } |
1938 SequenceNode* finally_block() const { return finally_block_; } | 1940 SequenceNode* finally_block() const { return finally_block_; } |
1939 const LocalVariable& context_var() const { return context_var_; } | 1941 const LocalVariable& context_var() const { return context_var_; } |
1940 intptr_t try_index() const { return try_index_; } | 1942 intptr_t try_index() const { return try_index_; } |
1941 | 1943 |
| 1944 SequenceNode* rethrow_clause() const { return rethrow_clause_; } |
| 1945 |
1942 virtual void VisitChildren(AstNodeVisitor* visitor) const { | 1946 virtual void VisitChildren(AstNodeVisitor* visitor) const { |
1943 try_block_->Visit(visitor); | 1947 try_block_->Visit(visitor); |
1944 if (catch_block_ != NULL) { | 1948 if (catch_block_ != NULL) { |
1945 catch_block_->Visit(visitor); | 1949 catch_block_->Visit(visitor); |
1946 } | 1950 } |
1947 if (finally_block_ != NULL) { | 1951 if (finally_block_ != NULL) { |
1948 finally_block_->Visit(visitor); | 1952 finally_block_->Visit(visitor); |
1949 } | 1953 } |
1950 } | 1954 } |
1951 | 1955 |
1952 DECLARE_COMMON_NODE_FUNCTIONS(TryCatchNode); | 1956 DECLARE_COMMON_NODE_FUNCTIONS(TryCatchNode); |
1953 | 1957 |
1954 private: | 1958 private: |
1955 SequenceNode* try_block_; | 1959 SequenceNode* try_block_; |
1956 const LocalVariable& context_var_; | 1960 const LocalVariable& context_var_; |
1957 CatchClauseNode* catch_block_; | 1961 CatchClauseNode* catch_block_; |
1958 SequenceNode* finally_block_; | 1962 SequenceNode* finally_block_; |
1959 const intptr_t try_index_; | 1963 const intptr_t try_index_; |
| 1964 SequenceNode* rethrow_clause_; |
1960 | 1965 |
1961 DISALLOW_COPY_AND_ASSIGN(TryCatchNode); | 1966 DISALLOW_COPY_AND_ASSIGN(TryCatchNode); |
1962 }; | 1967 }; |
1963 | 1968 |
1964 | 1969 |
1965 class ThrowNode : public AstNode { | 1970 class ThrowNode : public AstNode { |
1966 public: | 1971 public: |
1967 ThrowNode(intptr_t token_pos, AstNode* exception, AstNode* stacktrace) | 1972 ThrowNode(intptr_t token_pos, AstNode* exception, AstNode* stacktrace) |
1968 : AstNode(token_pos), exception_(exception), stacktrace_(stacktrace) { | 1973 : AstNode(token_pos), exception_(exception), stacktrace_(stacktrace) { |
1969 ASSERT(exception_ != NULL); | 1974 ASSERT(exception_ != NULL); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 const intptr_t try_index_; | 2024 const intptr_t try_index_; |
2020 | 2025 |
2021 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 2026 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
2022 }; | 2027 }; |
2023 | 2028 |
2024 } // namespace dart | 2029 } // namespace dart |
2025 | 2030 |
2026 #undef DECLARE_COMMON_NODE_FUNCTIONS | 2031 #undef DECLARE_COMMON_NODE_FUNCTIONS |
2027 | 2032 |
2028 #endif // VM_AST_H_ | 2033 #endif // VM_AST_H_ |
OLD | NEW |