OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_AST_H_ | 5 #ifndef V8_AST_H_ |
6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 // code generation. | 332 // code generation. |
333 kUninitialized, | 333 kUninitialized, |
334 // Evaluated for its side effects. | 334 // Evaluated for its side effects. |
335 kEffect, | 335 kEffect, |
336 // Evaluated for its value (and side effects). | 336 // Evaluated for its value (and side effects). |
337 kValue, | 337 kValue, |
338 // Evaluated for control flow (and side effects). | 338 // Evaluated for control flow (and side effects). |
339 kTest | 339 kTest |
340 }; | 340 }; |
341 | 341 |
| 342 // True iff the expression is a valid reference expression. |
342 virtual bool IsValidReferenceExpression() const { return false; } | 343 virtual bool IsValidReferenceExpression() const { return false; } |
343 | 344 |
344 // Helpers for ToBoolean conversion. | 345 // Helpers for ToBoolean conversion. |
345 virtual bool ToBooleanIsTrue() const { return false; } | 346 virtual bool ToBooleanIsTrue() const { return false; } |
346 virtual bool ToBooleanIsFalse() const { return false; } | 347 virtual bool ToBooleanIsFalse() const { return false; } |
347 | 348 |
348 // Symbols that cannot be parsed as array indices are considered property | 349 // Symbols that cannot be parsed as array indices are considered property |
349 // names. We do not treat symbols that can be array indexes as property | 350 // names. We do not treat symbols that can be array indexes as property |
350 // names because [] for string objects is handled only by keyed ICs. | 351 // names because [] for string objects is handled only by keyed ICs. |
351 virtual bool IsPropertyName() const { return false; } | 352 virtual bool IsPropertyName() const { return false; } |
352 | 353 |
353 // True iff the expression is a literal represented as a smi. | 354 // True iff the expression is a literal represented as a smi. |
354 bool IsSmiLiteral() const; | 355 bool IsSmiLiteral() const; |
355 | 356 |
356 // True iff the expression is a string literal. | 357 // True iff the expression is a string literal. |
357 bool IsStringLiteral() const; | 358 bool IsStringLiteral() const; |
358 | 359 |
359 // True iff the expression is the null literal. | 360 // True iff the expression is the null literal. |
360 bool IsNullLiteral() const; | 361 bool IsNullLiteral() const; |
361 | 362 |
362 // True if we can prove that the expression is the undefined literal. | 363 // True if we can prove that the expression is the undefined literal. |
363 bool IsUndefinedLiteral(Isolate* isolate) const; | 364 bool IsUndefinedLiteral(Isolate* isolate) const; |
364 | 365 |
| 366 // True iff the expression is a valid target for an assignment. |
| 367 bool IsValidReferenceExpressionOrThis() const; |
| 368 |
365 // Expression type bounds | 369 // Expression type bounds |
366 Bounds bounds() const { return bounds_; } | 370 Bounds bounds() const { return bounds_; } |
367 void set_bounds(Bounds bounds) { bounds_ = bounds; } | 371 void set_bounds(Bounds bounds) { bounds_ = bounds; } |
368 | 372 |
369 // Type feedback information for assignments and properties. | 373 // Type feedback information for assignments and properties. |
370 virtual bool IsMonomorphic() { | 374 virtual bool IsMonomorphic() { |
371 UNREACHABLE(); | 375 UNREACHABLE(); |
372 return false; | 376 return false; |
373 } | 377 } |
374 virtual SmallMapList* GetReceiverTypes() { | 378 virtual SmallMapList* GetReceiverTypes() { |
(...skipping 3248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3623 | 3627 |
3624 private: | 3628 private: |
3625 Zone* zone_; | 3629 Zone* zone_; |
3626 AstValueFactory* ast_value_factory_; | 3630 AstValueFactory* ast_value_factory_; |
3627 }; | 3631 }; |
3628 | 3632 |
3629 | 3633 |
3630 } } // namespace v8::internal | 3634 } } // namespace v8::internal |
3631 | 3635 |
3632 #endif // V8_AST_H_ | 3636 #endif // V8_AST_H_ |
OLD | NEW |