| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // (faster) prefix increments. | 281 // (faster) prefix increments. |
| 282 virtual void MarkAsStatement() { /* do nothing */ } | 282 virtual void MarkAsStatement() { /* do nothing */ } |
| 283 | 283 |
| 284 // True iff the result can be safely overwritten (to avoid allocation). | 284 // True iff the result can be safely overwritten (to avoid allocation). |
| 285 // False for operations that can return one of their operands. | 285 // False for operations that can return one of their operands. |
| 286 virtual bool ResultOverwriteAllowed() { return false; } | 286 virtual bool ResultOverwriteAllowed() { return false; } |
| 287 | 287 |
| 288 // True iff the expression is a literal represented as a smi. | 288 // True iff the expression is a literal represented as a smi. |
| 289 virtual bool IsSmiLiteral() { return false; } | 289 virtual bool IsSmiLiteral() { return false; } |
| 290 | 290 |
| 291 // True iff the expression is a string literal. |
| 292 virtual bool IsStringLiteral() { return false; } |
| 293 |
| 294 // True iff the expression is the null literal. |
| 295 virtual bool IsNullLiteral() { return false; } |
| 296 |
| 291 // Type feedback information for assignments and properties. | 297 // Type feedback information for assignments and properties. |
| 292 virtual bool IsMonomorphic() { | 298 virtual bool IsMonomorphic() { |
| 293 UNREACHABLE(); | 299 UNREACHABLE(); |
| 294 return false; | 300 return false; |
| 295 } | 301 } |
| 296 virtual bool IsArrayLength() { | 302 virtual bool IsArrayLength() { |
| 297 UNREACHABLE(); | 303 UNREACHABLE(); |
| 298 return false; | 304 return false; |
| 299 } | 305 } |
| 300 virtual SmallMapList* GetReceiverTypes() { | 306 virtual SmallMapList* GetReceiverTypes() { |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 | 889 |
| 884 class Literal: public Expression { | 890 class Literal: public Expression { |
| 885 public: | 891 public: |
| 886 Literal(Isolate* isolate, Handle<Object> handle) | 892 Literal(Isolate* isolate, Handle<Object> handle) |
| 887 : Expression(isolate), handle_(handle) { } | 893 : Expression(isolate), handle_(handle) { } |
| 888 | 894 |
| 889 DECLARE_NODE_TYPE(Literal) | 895 DECLARE_NODE_TYPE(Literal) |
| 890 | 896 |
| 891 virtual bool IsTrivial() { return true; } | 897 virtual bool IsTrivial() { return true; } |
| 892 virtual bool IsSmiLiteral() { return handle_->IsSmi(); } | 898 virtual bool IsSmiLiteral() { return handle_->IsSmi(); } |
| 899 virtual bool IsStringLiteral() { return handle_->IsString(); } |
| 900 virtual bool IsNullLiteral() { return handle_->IsNull(); } |
| 893 | 901 |
| 894 // Check if this literal is identical to the other literal. | 902 // Check if this literal is identical to the other literal. |
| 895 bool IsIdenticalTo(const Literal* other) const { | 903 bool IsIdenticalTo(const Literal* other) const { |
| 896 return handle_.is_identical_to(other->handle_); | 904 return handle_.is_identical_to(other->handle_); |
| 897 } | 905 } |
| 898 | 906 |
| 899 virtual bool IsPropertyName() { | 907 virtual bool IsPropertyName() { |
| 900 if (handle_->IsSymbol()) { | 908 if (handle_->IsSymbol()) { |
| 901 uint32_t ignored; | 909 uint32_t ignored; |
| 902 return !String::cast(*handle_)->AsArrayIndex(&ignored); | 910 return !String::cast(*handle_)->AsArrayIndex(&ignored); |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2121 | 2129 |
| 2122 private: | 2130 private: |
| 2123 Isolate* isolate_; | 2131 Isolate* isolate_; |
| 2124 bool stack_overflow_; | 2132 bool stack_overflow_; |
| 2125 }; | 2133 }; |
| 2126 | 2134 |
| 2127 | 2135 |
| 2128 } } // namespace v8::internal | 2136 } } // namespace v8::internal |
| 2129 | 2137 |
| 2130 #endif // V8_AST_H_ | 2138 #endif // V8_AST_H_ |
| OLD | NEW |