| 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_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
| 6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
| 7 | 7 |
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
| 10 #include "src/ast/modules.h" | 10 #include "src/ast/modules.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 // True iff the expression is a literal represented as a smi. | 324 // True iff the expression is a literal represented as a smi. |
| 325 bool IsSmiLiteral() const; | 325 bool IsSmiLiteral() const; |
| 326 | 326 |
| 327 // True iff the expression is a string literal. | 327 // True iff the expression is a string literal. |
| 328 bool IsStringLiteral() const; | 328 bool IsStringLiteral() const; |
| 329 | 329 |
| 330 // True iff the expression is the null literal. | 330 // True iff the expression is the null literal. |
| 331 bool IsNullLiteral() const; | 331 bool IsNullLiteral() const; |
| 332 | 332 |
| 333 // True if we can prove that the expression is the undefined literal. | 333 // True if we can prove that the expression is the undefined literal. Note |
| 334 bool IsUndefinedLiteral(Isolate* isolate) const; | 334 // that this also checks for loads of the global "undefined" variable. |
| 335 bool IsUndefinedLiteral() const; |
| 335 | 336 |
| 336 // True iff the expression is a valid target for an assignment. | 337 // True iff the expression is a valid target for an assignment. |
| 337 bool IsValidReferenceExpressionOrThis() const; | 338 bool IsValidReferenceExpressionOrThis() const; |
| 338 | 339 |
| 339 // Expression type bounds | 340 // Expression type bounds |
| 340 Bounds bounds() const { return bounds_; } | 341 Bounds bounds() const { return bounds_; } |
| 341 void set_bounds(Bounds bounds) { bounds_ = bounds; } | 342 void set_bounds(Bounds bounds) { bounds_ = bounds; } |
| 342 | 343 |
| 343 // Type feedback information for assignments and properties. | 344 // Type feedback information for assignments and properties. |
| 344 virtual bool IsMonomorphic() { | 345 virtual bool IsMonomorphic() { |
| (...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2278 // Type feedback information. | 2279 // Type feedback information. |
| 2279 static int num_ids() { return parent_num_ids() + 1; } | 2280 static int num_ids() { return parent_num_ids() + 1; } |
| 2280 TypeFeedbackId CompareOperationFeedbackId() const { | 2281 TypeFeedbackId CompareOperationFeedbackId() const { |
| 2281 return TypeFeedbackId(local_id(0)); | 2282 return TypeFeedbackId(local_id(0)); |
| 2282 } | 2283 } |
| 2283 Type* combined_type() const { return combined_type_; } | 2284 Type* combined_type() const { return combined_type_; } |
| 2284 void set_combined_type(Type* type) { combined_type_ = type; } | 2285 void set_combined_type(Type* type) { combined_type_ = type; } |
| 2285 | 2286 |
| 2286 // Match special cases. | 2287 // Match special cases. |
| 2287 bool IsLiteralCompareTypeof(Expression** expr, Handle<String>* check); | 2288 bool IsLiteralCompareTypeof(Expression** expr, Handle<String>* check); |
| 2288 bool IsLiteralCompareUndefined(Expression** expr, Isolate* isolate); | 2289 bool IsLiteralCompareUndefined(Expression** expr); |
| 2289 bool IsLiteralCompareNull(Expression** expr); | 2290 bool IsLiteralCompareNull(Expression** expr); |
| 2290 | 2291 |
| 2291 protected: | 2292 protected: |
| 2292 CompareOperation(Zone* zone, Token::Value op, Expression* left, | 2293 CompareOperation(Zone* zone, Token::Value op, Expression* left, |
| 2293 Expression* right, int pos) | 2294 Expression* right, int pos) |
| 2294 : Expression(zone, pos), | 2295 : Expression(zone, pos), |
| 2295 op_(op), | 2296 op_(op), |
| 2296 left_(left), | 2297 left_(left), |
| 2297 right_(right), | 2298 right_(right), |
| 2298 combined_type_(Type::None()) { | 2299 combined_type_(Type::None()) { |
| (...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3513 : NULL; \ | 3514 : NULL; \ |
| 3514 } | 3515 } |
| 3515 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3516 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3516 #undef DECLARE_NODE_FUNCTIONS | 3517 #undef DECLARE_NODE_FUNCTIONS |
| 3517 | 3518 |
| 3518 | 3519 |
| 3519 } // namespace internal | 3520 } // namespace internal |
| 3520 } // namespace v8 | 3521 } // namespace v8 |
| 3521 | 3522 |
| 3522 #endif // V8_AST_AST_H_ | 3523 #endif // V8_AST_AST_H_ |
| OLD | NEW |