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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 public: | 194 public: |
195 enum Context { | 195 enum Context { |
196 // Not assigned a context yet, or else will not be visited during | 196 // Not assigned a context yet, or else will not be visited during |
197 // code generation. | 197 // code generation. |
198 kUninitialized, | 198 kUninitialized, |
199 // Evaluated for its side effects. | 199 // Evaluated for its side effects. |
200 kEffect, | 200 kEffect, |
201 // Evaluated for its value (and side effects). | 201 // Evaluated for its value (and side effects). |
202 kValue, | 202 kValue, |
203 // Evaluated for control flow (and side effects). | 203 // Evaluated for control flow (and side effects). |
204 kTest, | 204 kTest |
205 // Evaluated for control flow and side effects. Value is also | |
206 // needed if true. | |
207 kValueTest, | |
208 // Evaluated for control flow and side effects. Value is also | |
209 // needed if false. | |
210 kTestValue | |
211 }; | 205 }; |
212 | 206 |
213 Expression() : bitfields_(0) {} | 207 Expression() : bitfields_(0) {} |
214 | 208 |
215 explicit Expression(Expression* other); | 209 explicit Expression(Expression* other); |
216 | 210 |
217 virtual Expression* AsExpression() { return this; } | 211 virtual Expression* AsExpression() { return this; } |
218 | 212 |
219 virtual bool IsValidLeftHandSide() { return false; } | 213 virtual bool IsValidLeftHandSide() { return false; } |
220 | 214 |
(...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 | 2091 |
2098 // Holds the result of copying an expression. | 2092 // Holds the result of copying an expression. |
2099 Expression* expr_; | 2093 Expression* expr_; |
2100 // Holds the result of copying a statement. | 2094 // Holds the result of copying a statement. |
2101 Statement* stmt_; | 2095 Statement* stmt_; |
2102 }; | 2096 }; |
2103 | 2097 |
2104 } } // namespace v8::internal | 2098 } } // namespace v8::internal |
2105 | 2099 |
2106 #endif // V8_AST_H_ | 2100 #endif // V8_AST_H_ |
OLD | NEW |