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 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1506 class Property: public Expression { | 1506 class Property: public Expression { |
1507 public: | 1507 public: |
1508 DECLARE_NODE_TYPE(Property) | 1508 DECLARE_NODE_TYPE(Property) |
1509 | 1509 |
1510 virtual bool IsValidLeftHandSide() { return true; } | 1510 virtual bool IsValidLeftHandSide() { return true; } |
1511 | 1511 |
1512 Expression* obj() const { return obj_; } | 1512 Expression* obj() const { return obj_; } |
1513 Expression* key() const { return key_; } | 1513 Expression* key() const { return key_; } |
1514 virtual int position() const { return pos_; } | 1514 virtual int position() const { return pos_; } |
1515 | 1515 |
1516 BailoutId ReturnId() const { return return_id_; } | 1516 BailoutId LoadId() const { return load_id_; } |
1517 | 1517 |
1518 bool IsStringLength() const { return is_string_length_; } | 1518 bool IsStringLength() const { return is_string_length_; } |
1519 bool IsStringAccess() const { return is_string_access_; } | 1519 bool IsStringAccess() const { return is_string_access_; } |
1520 bool IsFunctionPrototype() const { return is_function_prototype_; } | 1520 bool IsFunctionPrototype() const { return is_function_prototype_; } |
1521 | 1521 |
1522 // Type feedback information. | 1522 // Type feedback information. |
1523 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); | 1523 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); |
1524 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1524 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1525 virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; } | 1525 virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; } |
1526 bool IsArrayLength() { return is_array_length_; } | 1526 bool IsArrayLength() { return is_array_length_; } |
1527 bool IsUninitialized() { return is_uninitialized_; } | 1527 bool IsUninitialized() { return is_uninitialized_; } |
1528 TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } | 1528 TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } |
1529 | 1529 |
1530 protected: | 1530 protected: |
1531 template<class> friend class AstNodeFactory; | 1531 template<class> friend class AstNodeFactory; |
1532 | 1532 |
1533 Property(Isolate* isolate, | 1533 Property(Isolate* isolate, |
1534 Expression* obj, | 1534 Expression* obj, |
1535 Expression* key, | 1535 Expression* key, |
1536 int pos) | 1536 int pos) |
1537 : Expression(isolate), | 1537 : Expression(isolate), |
1538 obj_(obj), | 1538 obj_(obj), |
1539 key_(key), | 1539 key_(key), |
1540 pos_(pos), | 1540 pos_(pos), |
1541 return_id_(GetNextId(isolate)), | 1541 load_id_(GetNextId(isolate)), |
1542 is_monomorphic_(false), | 1542 is_monomorphic_(false), |
1543 is_uninitialized_(false), | 1543 is_uninitialized_(false), |
1544 is_array_length_(false), | 1544 is_array_length_(false), |
1545 is_string_length_(false), | 1545 is_string_length_(false), |
1546 is_string_access_(false), | 1546 is_string_access_(false), |
1547 is_function_prototype_(false) { } | 1547 is_function_prototype_(false) { } |
1548 | 1548 |
1549 private: | 1549 private: |
1550 Expression* obj_; | 1550 Expression* obj_; |
1551 Expression* key_; | 1551 Expression* key_; |
1552 int pos_; | 1552 int pos_; |
1553 const BailoutId return_id_; | 1553 const BailoutId load_id_; |
1554 | 1554 |
1555 SmallMapList receiver_types_; | 1555 SmallMapList receiver_types_; |
1556 bool is_monomorphic_ : 1; | 1556 bool is_monomorphic_ : 1; |
1557 bool is_uninitialized_ : 1; | 1557 bool is_uninitialized_ : 1; |
1558 bool is_array_length_ : 1; | 1558 bool is_array_length_ : 1; |
1559 bool is_string_length_ : 1; | 1559 bool is_string_length_ : 1; |
1560 bool is_string_access_ : 1; | 1560 bool is_string_access_ : 1; |
1561 bool is_function_prototype_ : 1; | 1561 bool is_function_prototype_ : 1; |
1562 }; | 1562 }; |
1563 | 1563 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1803 Expression* expression() const { return expression_; } | 1803 Expression* expression() const { return expression_; } |
1804 virtual int position() const { return pos_; } | 1804 virtual int position() const { return pos_; } |
1805 | 1805 |
1806 virtual void MarkAsStatement() { is_prefix_ = true; } | 1806 virtual void MarkAsStatement() { is_prefix_ = true; } |
1807 | 1807 |
1808 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* znoe); | 1808 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* znoe); |
1809 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1809 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1810 virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; } | 1810 virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; } |
1811 | 1811 |
1812 BailoutId AssignmentId() const { return assignment_id_; } | 1812 BailoutId AssignmentId() const { return assignment_id_; } |
1813 BailoutId CountId() const { return count_id_; } | 1813 BailoutId CountId() const { return count_id_; } |
Michael Starzinger
2012/08/07 13:11:39
I think we can get rid of this BailoutId accessor
Sven Panne
2012/08/07 14:02:00
Done.
| |
1814 | 1814 |
1815 TypeFeedbackId CountBinOpFeedbackId() const { return reuse(CountId()); } | 1815 TypeFeedbackId CountBinOpFeedbackId() const { return reuse(CountId()); } |
Michael Starzinger
2012/08/07 13:11:39
... and just use the underlying AST id directly he
Sven Panne
2012/08/07 14:02:00
Done.
| |
1816 TypeFeedbackId CountStoreFeedbackId() const { return reuse(id()); } | 1816 TypeFeedbackId CountStoreFeedbackId() const { return reuse(id()); } |
1817 | 1817 |
1818 | 1818 |
1819 protected: | 1819 protected: |
1820 template<class> friend class AstNodeFactory; | 1820 template<class> friend class AstNodeFactory; |
1821 | 1821 |
1822 CountOperation(Isolate* isolate, | 1822 CountOperation(Isolate* isolate, |
1823 Token::Value op, | 1823 Token::Value op, |
1824 bool is_prefix, | 1824 bool is_prefix, |
1825 Expression* expr, | 1825 Expression* expr, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1954 | 1954 |
1955 // An initialization block is a series of statments of the form | 1955 // An initialization block is a series of statments of the form |
1956 // x.y.z.a = ...; x.y.z.b = ...; etc. The parser marks the beginning and | 1956 // x.y.z.a = ...; x.y.z.b = ...; etc. The parser marks the beginning and |
1957 // ending of these blocks to allow for optimizations of initialization | 1957 // ending of these blocks to allow for optimizations of initialization |
1958 // blocks. | 1958 // blocks. |
1959 bool starts_initialization_block() { return block_start_; } | 1959 bool starts_initialization_block() { return block_start_; } |
1960 bool ends_initialization_block() { return block_end_; } | 1960 bool ends_initialization_block() { return block_end_; } |
1961 void mark_block_start() { block_start_ = true; } | 1961 void mark_block_start() { block_start_ = true; } |
1962 void mark_block_end() { block_end_ = true; } | 1962 void mark_block_end() { block_end_ = true; } |
1963 | 1963 |
1964 BailoutId CompoundLoadId() const { return compound_load_id_; } | |
1965 BailoutId AssignmentId() const { return assignment_id_; } | 1964 BailoutId AssignmentId() const { return assignment_id_; } |
1966 | 1965 |
1967 // Type feedback information. | 1966 // Type feedback information. |
1968 TypeFeedbackId AssignmentFeedbackId() { return reuse(id()); } | 1967 TypeFeedbackId AssignmentFeedbackId() { return reuse(id()); } |
1969 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); | 1968 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); |
1970 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1969 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1971 virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; } | 1970 virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; } |
1972 | 1971 |
1973 protected: | 1972 protected: |
1974 template<class> friend class AstNodeFactory; | 1973 template<class> friend class AstNodeFactory; |
(...skipping 12 matching lines...) Expand all Loading... | |
1987 factory->NewBinaryOperation(binary_op(), target_, value_, pos_ + 1); | 1986 factory->NewBinaryOperation(binary_op(), target_, value_, pos_ + 1); |
1988 } | 1987 } |
1989 } | 1988 } |
1990 | 1989 |
1991 private: | 1990 private: |
1992 Token::Value op_; | 1991 Token::Value op_; |
1993 Expression* target_; | 1992 Expression* target_; |
1994 Expression* value_; | 1993 Expression* value_; |
1995 int pos_; | 1994 int pos_; |
1996 BinaryOperation* binary_operation_; | 1995 BinaryOperation* binary_operation_; |
1997 const BailoutId compound_load_id_; | |
1998 const BailoutId assignment_id_; | 1996 const BailoutId assignment_id_; |
1999 | 1997 |
2000 bool block_start_; | 1998 bool block_start_; |
2001 bool block_end_; | 1999 bool block_end_; |
2002 | 2000 |
2003 bool is_monomorphic_; | 2001 bool is_monomorphic_; |
2004 SmallMapList receiver_types_; | 2002 SmallMapList receiver_types_; |
2005 }; | 2003 }; |
2006 | 2004 |
2007 | 2005 |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2987 private: | 2985 private: |
2988 Isolate* isolate_; | 2986 Isolate* isolate_; |
2989 Zone* zone_; | 2987 Zone* zone_; |
2990 Visitor visitor_; | 2988 Visitor visitor_; |
2991 }; | 2989 }; |
2992 | 2990 |
2993 | 2991 |
2994 } } // namespace v8::internal | 2992 } } // namespace v8::internal |
2995 | 2993 |
2996 #endif // V8_AST_H_ | 2994 #endif // V8_AST_H_ |
OLD | NEW |