OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 void set_statement_pos(int statement_pos) { statement_pos_ = statement_pos; } | 165 void set_statement_pos(int statement_pos) { statement_pos_ = statement_pos; } |
166 int statement_pos() const { return statement_pos_; } | 166 int statement_pos() const { return statement_pos_; } |
167 | 167 |
168 private: | 168 private: |
169 int statement_pos_; | 169 int statement_pos_; |
170 }; | 170 }; |
171 | 171 |
172 | 172 |
173 class Expression: public AstNode { | 173 class Expression: public AstNode { |
174 public: | 174 public: |
175 enum Context { | |
176 // Not assigned a context yet, or else will not be visited during | |
177 // code generation. | |
178 kUninitialized, | |
179 // Evaluated for its side effects. | |
180 kEffect, | |
181 // Evaluated for its value (and side effects). | |
182 kValue, | |
183 // Evaluated for control flow (and side effects). | |
184 kTest | |
185 }; | |
186 | |
187 Expression() : bitfields_(0) {} | 175 Expression() : bitfields_(0) {} |
188 | 176 |
189 virtual Expression* AsExpression() { return this; } | 177 virtual Expression* AsExpression() { return this; } |
190 | 178 |
191 virtual bool IsTrivial() { return false; } | 179 virtual bool IsTrivial() { return false; } |
192 virtual bool IsValidLeftHandSide() { return false; } | 180 virtual bool IsValidLeftHandSide() { return false; } |
193 | 181 |
194 // Symbols that cannot be parsed as array indices are considered property | 182 // Symbols that cannot be parsed as array indices are considered property |
195 // names. We do not treat symbols that can be array indexes as property | 183 // names. We do not treat symbols that can be array indexes as property |
196 // names because [] for string objects is handled only by keyed ICs. | 184 // names because [] for string objects is handled only by keyed ICs. |
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 AST_NODE_LIST(DEF_VISIT) | 1914 AST_NODE_LIST(DEF_VISIT) |
1927 #undef DEF_VISIT | 1915 #undef DEF_VISIT |
1928 | 1916 |
1929 private: | 1917 private: |
1930 bool stack_overflow_; | 1918 bool stack_overflow_; |
1931 }; | 1919 }; |
1932 | 1920 |
1933 } } // namespace v8::internal | 1921 } } // namespace v8::internal |
1934 | 1922 |
1935 #endif // V8_AST_H_ | 1923 #endif // V8_AST_H_ |
OLD | NEW |