Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 SmallMapList* types = GetReceiverTypes(); | 376 SmallMapList* types = GetReceiverTypes(); |
| 377 ASSERT(types != NULL && types->length() == 1); | 377 ASSERT(types != NULL && types->length() == 1); |
| 378 return types->at(0); | 378 return types->at(0); |
| 379 } | 379 } |
| 380 virtual KeyedAccessStoreMode GetStoreMode() { | 380 virtual KeyedAccessStoreMode GetStoreMode() { |
| 381 UNREACHABLE(); | 381 UNREACHABLE(); |
| 382 return STANDARD_STORE; | 382 return STANDARD_STORE; |
| 383 } | 383 } |
| 384 | 384 |
| 385 // TODO(rossberg): this should move to its own AST node eventually. | 385 // TODO(rossberg): this should move to its own AST node eventually. |
| 386 void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); | 386 virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); |
| 387 byte to_boolean_types() const { return to_boolean_types_; } | 387 byte to_boolean_types() const { return to_boolean_types_; } |
| 388 | 388 |
| 389 BailoutId id() const { return id_; } | 389 BailoutId id() const { return id_; } |
| 390 TypeFeedbackId test_id() const { return test_id_; } | 390 TypeFeedbackId test_id() const { return test_id_; } |
| 391 | 391 |
| 392 protected: | 392 protected: |
| 393 explicit Expression(Isolate* isolate) | 393 explicit Expression(Isolate* isolate) |
| 394 : upper_type_(Type::Any(), isolate), | 394 : upper_type_(Type::Any(), isolate), |
| 395 lower_type_(Type::None(), isolate), | 395 lower_type_(Type::None(), isolate), |
| 396 id_(GetNextId(isolate)), | 396 id_(GetNextId(isolate)), |
| 397 test_id_(GetNextId(isolate)) {} | 397 test_id_(GetNextId(isolate)) {} |
| 398 byte to_boolean_types_; | |
|
Jakob Kummerow
2013/06/24 15:06:35
nit: the style guide forbids non-private fields. U
| |
| 398 | 399 |
| 399 private: | 400 private: |
| 400 Handle<Type> upper_type_; | 401 Handle<Type> upper_type_; |
| 401 Handle<Type> lower_type_; | 402 Handle<Type> lower_type_; |
| 402 byte to_boolean_types_; | |
| 403 | 403 |
| 404 const BailoutId id_; | 404 const BailoutId id_; |
| 405 const TypeFeedbackId test_id_; | 405 const TypeFeedbackId test_id_; |
| 406 }; | 406 }; |
| 407 | 407 |
| 408 | 408 |
| 409 class BreakableStatement: public Statement { | 409 class BreakableStatement: public Statement { |
| 410 public: | 410 public: |
| 411 enum BreakableType { | 411 enum BreakableType { |
| 412 TARGET_FOR_ANONYMOUS, | 412 TARGET_FOR_ANONYMOUS, |
| (...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1834 | 1834 |
| 1835 Token::Value op() const { return op_; } | 1835 Token::Value op() const { return op_; } |
| 1836 Expression* expression() const { return expression_; } | 1836 Expression* expression() const { return expression_; } |
| 1837 virtual int position() const { return pos_; } | 1837 virtual int position() const { return pos_; } |
| 1838 | 1838 |
| 1839 BailoutId MaterializeTrueId() { return materialize_true_id_; } | 1839 BailoutId MaterializeTrueId() { return materialize_true_id_; } |
| 1840 BailoutId MaterializeFalseId() { return materialize_false_id_; } | 1840 BailoutId MaterializeFalseId() { return materialize_false_id_; } |
| 1841 | 1841 |
| 1842 TypeFeedbackId UnaryOperationFeedbackId() const { return reuse(id()); } | 1842 TypeFeedbackId UnaryOperationFeedbackId() const { return reuse(id()); } |
| 1843 | 1843 |
| 1844 virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); | |
| 1845 | |
| 1844 protected: | 1846 protected: |
| 1845 UnaryOperation(Isolate* isolate, | 1847 UnaryOperation(Isolate* isolate, |
| 1846 Token::Value op, | 1848 Token::Value op, |
| 1847 Expression* expression, | 1849 Expression* expression, |
| 1848 int pos) | 1850 int pos) |
| 1849 : Expression(isolate), | 1851 : Expression(isolate), |
| 1850 op_(op), | 1852 op_(op), |
| 1851 expression_(expression), | 1853 expression_(expression), |
| 1852 pos_(pos), | 1854 pos_(pos), |
| 1853 materialize_true_id_(GetNextId(isolate)), | 1855 materialize_true_id_(GetNextId(isolate)), |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 1877 Expression* left() const { return left_; } | 1879 Expression* left() const { return left_; } |
| 1878 Expression* right() const { return right_; } | 1880 Expression* right() const { return right_; } |
| 1879 virtual int position() const { return pos_; } | 1881 virtual int position() const { return pos_; } |
| 1880 | 1882 |
| 1881 BailoutId RightId() const { return right_id_; } | 1883 BailoutId RightId() const { return right_id_; } |
| 1882 | 1884 |
| 1883 TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); } | 1885 TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); } |
| 1884 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } | 1886 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } |
| 1885 void set_fixed_right_arg(Maybe<int> arg) { fixed_right_arg_ = arg; } | 1887 void set_fixed_right_arg(Maybe<int> arg) { fixed_right_arg_ = arg; } |
| 1886 | 1888 |
| 1889 virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); | |
| 1890 | |
| 1887 protected: | 1891 protected: |
| 1888 BinaryOperation(Isolate* isolate, | 1892 BinaryOperation(Isolate* isolate, |
| 1889 Token::Value op, | 1893 Token::Value op, |
| 1890 Expression* left, | 1894 Expression* left, |
| 1891 Expression* right, | 1895 Expression* right, |
| 1892 int pos) | 1896 int pos) |
| 1893 : Expression(isolate), | 1897 : Expression(isolate), |
| 1894 op_(op), | 1898 op_(op), |
| 1895 left_(left), | 1899 left_(left), |
| 1896 right_(right), | 1900 right_(right), |
| (...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3208 private: | 3212 private: |
| 3209 Isolate* isolate_; | 3213 Isolate* isolate_; |
| 3210 Zone* zone_; | 3214 Zone* zone_; |
| 3211 Visitor visitor_; | 3215 Visitor visitor_; |
| 3212 }; | 3216 }; |
| 3213 | 3217 |
| 3214 | 3218 |
| 3215 } } // namespace v8::internal | 3219 } } // namespace v8::internal |
| 3216 | 3220 |
| 3217 #endif // V8_AST_H_ | 3221 #endif // V8_AST_H_ |
| OLD | NEW |