Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: src/ast.h

Issue 10832157: Unify handling of bailout IDs for property loads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporated review comments. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_; }
1814 1813
1815 TypeFeedbackId CountBinOpFeedbackId() const { return reuse(CountId()); } 1814 TypeFeedbackId CountBinOpFeedbackId() const { return count_id_; }
1816 TypeFeedbackId CountStoreFeedbackId() const { return reuse(id()); } 1815 TypeFeedbackId CountStoreFeedbackId() const { return reuse(id()); }
1817 1816
1818
1819 protected: 1817 protected:
1820 template<class> friend class AstNodeFactory; 1818 template<class> friend class AstNodeFactory;
1821 1819
1822 CountOperation(Isolate* isolate, 1820 CountOperation(Isolate* isolate,
1823 Token::Value op, 1821 Token::Value op,
1824 bool is_prefix, 1822 bool is_prefix,
1825 Expression* expr, 1823 Expression* expr,
1826 int pos) 1824 int pos)
1827 : Expression(isolate), 1825 : Expression(isolate),
1828 op_(op), 1826 op_(op),
1829 is_prefix_(is_prefix), 1827 is_prefix_(is_prefix),
1830 expression_(expr), 1828 expression_(expr),
1831 pos_(pos), 1829 pos_(pos),
1832 assignment_id_(GetNextId(isolate)), 1830 assignment_id_(GetNextId(isolate)),
1833 count_id_(GetNextId(isolate)) {} 1831 count_id_(GetNextId(isolate)) {}
1834 1832
1835 private: 1833 private:
1836 Token::Value op_; 1834 Token::Value op_;
1837 bool is_prefix_; 1835 bool is_prefix_;
1838 bool is_monomorphic_; 1836 bool is_monomorphic_;
1839 Expression* expression_; 1837 Expression* expression_;
1840 int pos_; 1838 int pos_;
1841 const BailoutId assignment_id_; 1839 const BailoutId assignment_id_;
1842 const BailoutId count_id_; 1840 const TypeFeedbackId count_id_;
1843 SmallMapList receiver_types_; 1841 SmallMapList receiver_types_;
1844 }; 1842 };
1845 1843
1846 1844
1847 class CompareOperation: public Expression { 1845 class CompareOperation: public Expression {
1848 public: 1846 public:
1849 DECLARE_NODE_TYPE(CompareOperation) 1847 DECLARE_NODE_TYPE(CompareOperation)
1850 1848
1851 Token::Value op() const { return op_; } 1849 Token::Value op() const { return op_; }
1852 Expression* left() const { return left_; } 1850 Expression* left() const { return left_; }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1954 1952
1955 // An initialization block is a series of statments of the form 1953 // 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 1954 // 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 1955 // ending of these blocks to allow for optimizations of initialization
1958 // blocks. 1956 // blocks.
1959 bool starts_initialization_block() { return block_start_; } 1957 bool starts_initialization_block() { return block_start_; }
1960 bool ends_initialization_block() { return block_end_; } 1958 bool ends_initialization_block() { return block_end_; }
1961 void mark_block_start() { block_start_ = true; } 1959 void mark_block_start() { block_start_ = true; }
1962 void mark_block_end() { block_end_ = true; } 1960 void mark_block_end() { block_end_ = true; }
1963 1961
1964 BailoutId CompoundLoadId() const { return compound_load_id_; }
1965 BailoutId AssignmentId() const { return assignment_id_; } 1962 BailoutId AssignmentId() const { return assignment_id_; }
1966 1963
1967 // Type feedback information. 1964 // Type feedback information.
1968 TypeFeedbackId AssignmentFeedbackId() { return reuse(id()); } 1965 TypeFeedbackId AssignmentFeedbackId() { return reuse(id()); }
1969 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); 1966 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone);
1970 virtual bool IsMonomorphic() { return is_monomorphic_; } 1967 virtual bool IsMonomorphic() { return is_monomorphic_; }
1971 virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; } 1968 virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
1972 1969
1973 protected: 1970 protected:
1974 template<class> friend class AstNodeFactory; 1971 template<class> friend class AstNodeFactory;
(...skipping 12 matching lines...) Expand all
1987 factory->NewBinaryOperation(binary_op(), target_, value_, pos_ + 1); 1984 factory->NewBinaryOperation(binary_op(), target_, value_, pos_ + 1);
1988 } 1985 }
1989 } 1986 }
1990 1987
1991 private: 1988 private:
1992 Token::Value op_; 1989 Token::Value op_;
1993 Expression* target_; 1990 Expression* target_;
1994 Expression* value_; 1991 Expression* value_;
1995 int pos_; 1992 int pos_;
1996 BinaryOperation* binary_operation_; 1993 BinaryOperation* binary_operation_;
1997 const BailoutId compound_load_id_;
1998 const BailoutId assignment_id_; 1994 const BailoutId assignment_id_;
1999 1995
2000 bool block_start_; 1996 bool block_start_;
2001 bool block_end_; 1997 bool block_end_;
2002 1998
2003 bool is_monomorphic_; 1999 bool is_monomorphic_;
2004 SmallMapList receiver_types_; 2000 SmallMapList receiver_types_;
2005 }; 2001 };
2006 2002
2007 2003
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2987 private: 2983 private:
2988 Isolate* isolate_; 2984 Isolate* isolate_;
2989 Zone* zone_; 2985 Zone* zone_;
2990 Visitor visitor_; 2986 Visitor visitor_;
2991 }; 2987 };
2992 2988
2993 2989
2994 } } // namespace v8::internal 2990 } } // namespace v8::internal
2995 2991
2996 #endif // V8_AST_H_ 2992 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698