| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 bool IsStringLiteral(); | 351 bool IsStringLiteral(); |
| 352 | 352 |
| 353 // True iff the expression is the null literal. | 353 // True iff the expression is the null literal. |
| 354 bool IsNullLiteral(); | 354 bool IsNullLiteral(); |
| 355 | 355 |
| 356 // True iff the expression is the undefined literal. | 356 // True iff the expression is the undefined literal. |
| 357 bool IsUndefinedLiteral(); | 357 bool IsUndefinedLiteral(); |
| 358 | 358 |
| 359 // Expression type | 359 // Expression type |
| 360 Handle<Type> type() { return type_; } | 360 Handle<Type> type() { return type_; } |
| 361 void set_type(Handle<Type> type) { type_ = type; } |
| 361 | 362 |
| 362 // Type feedback information for assignments and properties. | 363 // Type feedback information for assignments and properties. |
| 363 virtual bool IsMonomorphic() { | 364 virtual bool IsMonomorphic() { |
| 364 UNREACHABLE(); | 365 UNREACHABLE(); |
| 365 return false; | 366 return false; |
| 366 } | 367 } |
| 367 virtual SmallMapList* GetReceiverTypes() { | 368 virtual SmallMapList* GetReceiverTypes() { |
| 368 UNREACHABLE(); | 369 UNREACHABLE(); |
| 369 return NULL; | 370 return NULL; |
| 370 } | 371 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 381 | 382 |
| 382 // TODO(rossberg): this should move to its own AST node eventually. | 383 // TODO(rossberg): this should move to its own AST node eventually. |
| 383 void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); | 384 void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); |
| 384 byte to_boolean_types() const { return to_boolean_types_; } | 385 byte to_boolean_types() const { return to_boolean_types_; } |
| 385 | 386 |
| 386 BailoutId id() const { return id_; } | 387 BailoutId id() const { return id_; } |
| 387 TypeFeedbackId test_id() const { return test_id_; } | 388 TypeFeedbackId test_id() const { return test_id_; } |
| 388 | 389 |
| 389 protected: | 390 protected: |
| 390 explicit Expression(Isolate* isolate) | 391 explicit Expression(Isolate* isolate) |
| 391 : type_(Type::Any(), isolate), | 392 : type_(Type::None(), isolate), |
| 392 id_(GetNextId(isolate)), | 393 id_(GetNextId(isolate)), |
| 393 test_id_(GetNextId(isolate)) {} | 394 test_id_(GetNextId(isolate)) {} |
| 394 | 395 |
| 395 private: | 396 private: |
| 396 Handle<Type> type_; | 397 Handle<Type> type_; |
| 397 byte to_boolean_types_; | 398 byte to_boolean_types_; |
| 398 | 399 |
| 399 const BailoutId id_; | 400 const BailoutId id_; |
| 400 const TypeFeedbackId test_id_; | 401 const TypeFeedbackId test_id_; |
| 401 }; | 402 }; |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 ZoneList<Statement*>* statements() const { return statements_; } | 1100 ZoneList<Statement*>* statements() const { return statements_; } |
| 1100 | 1101 |
| 1101 int position() const { return position_; } | 1102 int position() const { return position_; } |
| 1102 void set_position(int pos) { position_ = pos; } | 1103 void set_position(int pos) { position_ = pos; } |
| 1103 | 1104 |
| 1104 BailoutId EntryId() const { return entry_id_; } | 1105 BailoutId EntryId() const { return entry_id_; } |
| 1105 | 1106 |
| 1106 // Type feedback information. | 1107 // Type feedback information. |
| 1107 TypeFeedbackId CompareId() { return compare_id_; } | 1108 TypeFeedbackId CompareId() { return compare_id_; } |
| 1108 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1109 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| 1109 bool IsSmiCompare() { return compare_type_ == SMI_ONLY; } | 1110 Handle<Type> compare_type() { return compare_type_; } |
| 1110 bool IsNameCompare() { return compare_type_ == NAME_ONLY; } | |
| 1111 bool IsStringCompare() { return compare_type_ == STRING_ONLY; } | |
| 1112 bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; } | |
| 1113 | 1111 |
| 1114 private: | 1112 private: |
| 1115 Expression* label_; | 1113 Expression* label_; |
| 1116 Label body_target_; | 1114 Label body_target_; |
| 1117 ZoneList<Statement*>* statements_; | 1115 ZoneList<Statement*>* statements_; |
| 1118 int position_; | 1116 int position_; |
| 1119 enum CompareTypeFeedback { | 1117 Handle<Type> compare_type_; |
| 1120 NONE, | 1118 |
| 1121 SMI_ONLY, | |
| 1122 NAME_ONLY, | |
| 1123 STRING_ONLY, | |
| 1124 OBJECT_ONLY | |
| 1125 }; | |
| 1126 CompareTypeFeedback compare_type_; | |
| 1127 const TypeFeedbackId compare_id_; | 1119 const TypeFeedbackId compare_id_; |
| 1128 const BailoutId entry_id_; | 1120 const BailoutId entry_id_; |
| 1129 }; | 1121 }; |
| 1130 | 1122 |
| 1131 | 1123 |
| 1132 class SwitchStatement: public BreakableStatement { | 1124 class SwitchStatement: public BreakableStatement { |
| 1133 public: | 1125 public: |
| 1134 DECLARE_NODE_TYPE(SwitchStatement) | 1126 DECLARE_NODE_TYPE(SwitchStatement) |
| 1135 | 1127 |
| 1136 void Initialize(Expression* tag, ZoneList<CaseClause*>* cases) { | 1128 void Initialize(Expression* tag, ZoneList<CaseClause*>* cases) { |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 check_type_ = RECEIVER_MAP_CHECK; | 1690 check_type_ = RECEIVER_MAP_CHECK; |
| 1699 } | 1691 } |
| 1700 | 1692 |
| 1701 Handle<JSFunction> target() { return target_; } | 1693 Handle<JSFunction> target() { return target_; } |
| 1702 | 1694 |
| 1703 // A cache for the holder, set as a side effect of computing the target of the | 1695 // A cache for the holder, set as a side effect of computing the target of the |
| 1704 // call. Note that it contains the null handle when the receiver is the same | 1696 // call. Note that it contains the null handle when the receiver is the same |
| 1705 // as the holder! | 1697 // as the holder! |
| 1706 Handle<JSObject> holder() { return holder_; } | 1698 Handle<JSObject> holder() { return holder_; } |
| 1707 | 1699 |
| 1708 Handle<JSGlobalPropertyCell> cell() { return cell_; } | 1700 Handle<Cell> cell() { return cell_; } |
| 1709 | 1701 |
| 1710 bool ComputeTarget(Handle<Map> type, Handle<String> name); | 1702 bool ComputeTarget(Handle<Map> type, Handle<String> name); |
| 1711 bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup); | 1703 bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup); |
| 1712 | 1704 |
| 1713 BailoutId ReturnId() const { return return_id_; } | 1705 BailoutId ReturnId() const { return return_id_; } |
| 1714 | 1706 |
| 1715 // TODO(rossberg): this should really move somewhere else (and be merged with | 1707 // TODO(rossberg): this should really move somewhere else (and be merged with |
| 1716 // various similar methods in objets.cc), but for now... | 1708 // various similar methods in objets.cc), but for now... |
| 1717 static Handle<JSObject> GetPrototypeForPrimitiveCheck( | 1709 static Handle<JSObject> GetPrototypeForPrimitiveCheck( |
| 1718 CheckType check, Isolate* isolate); | 1710 CheckType check, Isolate* isolate); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1738 private: | 1730 private: |
| 1739 Expression* expression_; | 1731 Expression* expression_; |
| 1740 ZoneList<Expression*>* arguments_; | 1732 ZoneList<Expression*>* arguments_; |
| 1741 int pos_; | 1733 int pos_; |
| 1742 | 1734 |
| 1743 bool is_monomorphic_; | 1735 bool is_monomorphic_; |
| 1744 CheckType check_type_; | 1736 CheckType check_type_; |
| 1745 SmallMapList receiver_types_; | 1737 SmallMapList receiver_types_; |
| 1746 Handle<JSFunction> target_; | 1738 Handle<JSFunction> target_; |
| 1747 Handle<JSObject> holder_; | 1739 Handle<JSObject> holder_; |
| 1748 Handle<JSGlobalPropertyCell> cell_; | 1740 Handle<Cell> cell_; |
| 1749 | 1741 |
| 1750 const BailoutId return_id_; | 1742 const BailoutId return_id_; |
| 1751 }; | 1743 }; |
| 1752 | 1744 |
| 1753 | 1745 |
| 1754 class CallNew: public Expression { | 1746 class CallNew: public Expression { |
| 1755 public: | 1747 public: |
| 1756 DECLARE_NODE_TYPE(CallNew) | 1748 DECLARE_NODE_TYPE(CallNew) |
| 1757 | 1749 |
| 1758 Expression* expression() const { return expression_; } | 1750 Expression* expression() const { return expression_; } |
| 1759 ZoneList<Expression*>* arguments() const { return arguments_; } | 1751 ZoneList<Expression*>* arguments() const { return arguments_; } |
| 1760 virtual int position() const { return pos_; } | 1752 virtual int position() const { return pos_; } |
| 1761 | 1753 |
| 1762 // Type feedback information. | 1754 // Type feedback information. |
| 1763 TypeFeedbackId CallNewFeedbackId() const { return reuse(id()); } | 1755 TypeFeedbackId CallNewFeedbackId() const { return reuse(id()); } |
| 1764 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1756 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| 1765 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1757 virtual bool IsMonomorphic() { return is_monomorphic_; } |
| 1766 Handle<JSFunction> target() const { return target_; } | 1758 Handle<JSFunction> target() const { return target_; } |
| 1767 ElementsKind elements_kind() const { return elements_kind_; } | 1759 ElementsKind elements_kind() const { return elements_kind_; } |
| 1768 Handle<JSGlobalPropertyCell> allocation_info_cell() const { | 1760 Handle<Cell> allocation_info_cell() const { |
| 1769 return allocation_info_cell_; | 1761 return allocation_info_cell_; |
| 1770 } | 1762 } |
| 1771 | 1763 |
| 1772 BailoutId ReturnId() const { return return_id_; } | 1764 BailoutId ReturnId() const { return return_id_; } |
| 1773 | 1765 |
| 1774 protected: | 1766 protected: |
| 1775 CallNew(Isolate* isolate, | 1767 CallNew(Isolate* isolate, |
| 1776 Expression* expression, | 1768 Expression* expression, |
| 1777 ZoneList<Expression*>* arguments, | 1769 ZoneList<Expression*>* arguments, |
| 1778 int pos) | 1770 int pos) |
| 1779 : Expression(isolate), | 1771 : Expression(isolate), |
| 1780 expression_(expression), | 1772 expression_(expression), |
| 1781 arguments_(arguments), | 1773 arguments_(arguments), |
| 1782 pos_(pos), | 1774 pos_(pos), |
| 1783 is_monomorphic_(false), | 1775 is_monomorphic_(false), |
| 1784 elements_kind_(GetInitialFastElementsKind()), | 1776 elements_kind_(GetInitialFastElementsKind()), |
| 1785 return_id_(GetNextId(isolate)) { } | 1777 return_id_(GetNextId(isolate)) { } |
| 1786 | 1778 |
| 1787 private: | 1779 private: |
| 1788 Expression* expression_; | 1780 Expression* expression_; |
| 1789 ZoneList<Expression*>* arguments_; | 1781 ZoneList<Expression*>* arguments_; |
| 1790 int pos_; | 1782 int pos_; |
| 1791 | 1783 |
| 1792 bool is_monomorphic_; | 1784 bool is_monomorphic_; |
| 1793 Handle<JSFunction> target_; | 1785 Handle<JSFunction> target_; |
| 1794 ElementsKind elements_kind_; | 1786 ElementsKind elements_kind_; |
| 1795 Handle<JSGlobalPropertyCell> allocation_info_cell_; | 1787 Handle<Cell> allocation_info_cell_; |
| 1796 | 1788 |
| 1797 const BailoutId return_id_; | 1789 const BailoutId return_id_; |
| 1798 }; | 1790 }; |
| 1799 | 1791 |
| 1800 | 1792 |
| 1801 // The CallRuntime class does not represent any official JavaScript | 1793 // The CallRuntime class does not represent any official JavaScript |
| 1802 // language construct. Instead it is used to call a C or JS function | 1794 // language construct. Instead it is used to call a C or JS function |
| 1803 // with a set of arguments. This is used from the builtins that are | 1795 // with a set of arguments. This is used from the builtins that are |
| 1804 // implemented in JavaScript (see "v8natives.js"). | 1796 // implemented in JavaScript (see "v8natives.js"). |
| 1805 class CallRuntime: public Expression { | 1797 class CallRuntime: public Expression { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1838 | 1830 |
| 1839 Token::Value op() const { return op_; } | 1831 Token::Value op() const { return op_; } |
| 1840 Expression* expression() const { return expression_; } | 1832 Expression* expression() const { return expression_; } |
| 1841 virtual int position() const { return pos_; } | 1833 virtual int position() const { return pos_; } |
| 1842 | 1834 |
| 1843 BailoutId MaterializeTrueId() { return materialize_true_id_; } | 1835 BailoutId MaterializeTrueId() { return materialize_true_id_; } |
| 1844 BailoutId MaterializeFalseId() { return materialize_false_id_; } | 1836 BailoutId MaterializeFalseId() { return materialize_false_id_; } |
| 1845 | 1837 |
| 1846 TypeFeedbackId UnaryOperationFeedbackId() const { return reuse(id()); } | 1838 TypeFeedbackId UnaryOperationFeedbackId() const { return reuse(id()); } |
| 1847 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1839 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| 1848 TypeInfo type() const { return type_; } | 1840 Handle<Type> type() const { return type_; } |
| 1849 | 1841 |
| 1850 protected: | 1842 protected: |
| 1851 UnaryOperation(Isolate* isolate, | 1843 UnaryOperation(Isolate* isolate, |
| 1852 Token::Value op, | 1844 Token::Value op, |
| 1853 Expression* expression, | 1845 Expression* expression, |
| 1854 int pos) | 1846 int pos) |
| 1855 : Expression(isolate), | 1847 : Expression(isolate), |
| 1856 op_(op), | 1848 op_(op), |
| 1857 expression_(expression), | 1849 expression_(expression), |
| 1858 pos_(pos), | 1850 pos_(pos), |
| 1859 materialize_true_id_(GetNextId(isolate)), | 1851 materialize_true_id_(GetNextId(isolate)), |
| 1860 materialize_false_id_(GetNextId(isolate)) { | 1852 materialize_false_id_(GetNextId(isolate)) { |
| 1861 ASSERT(Token::IsUnaryOp(op)); | 1853 ASSERT(Token::IsUnaryOp(op)); |
| 1862 } | 1854 } |
| 1863 | 1855 |
| 1864 private: | 1856 private: |
| 1865 Token::Value op_; | 1857 Token::Value op_; |
| 1866 Expression* expression_; | 1858 Expression* expression_; |
| 1867 int pos_; | 1859 int pos_; |
| 1868 | 1860 |
| 1869 TypeInfo type_; | 1861 Handle<Type> type_; |
| 1870 | 1862 |
| 1871 // For unary not (Token::NOT), the AST ids where true and false will | 1863 // For unary not (Token::NOT), the AST ids where true and false will |
| 1872 // actually be materialized, respectively. | 1864 // actually be materialized, respectively. |
| 1873 const BailoutId materialize_true_id_; | 1865 const BailoutId materialize_true_id_; |
| 1874 const BailoutId materialize_false_id_; | 1866 const BailoutId materialize_false_id_; |
| 1875 }; | 1867 }; |
| 1876 | 1868 |
| 1877 | 1869 |
| 1878 class BinaryOperation: public Expression { | 1870 class BinaryOperation: public Expression { |
| 1879 public: | 1871 public: |
| 1880 DECLARE_NODE_TYPE(BinaryOperation) | 1872 DECLARE_NODE_TYPE(BinaryOperation) |
| 1881 | 1873 |
| 1882 virtual bool ResultOverwriteAllowed(); | 1874 virtual bool ResultOverwriteAllowed(); |
| 1883 | 1875 |
| 1884 Token::Value op() const { return op_; } | 1876 Token::Value op() const { return op_; } |
| 1885 Expression* left() const { return left_; } | 1877 Expression* left() const { return left_; } |
| 1886 Expression* right() const { return right_; } | 1878 Expression* right() const { return right_; } |
| 1887 virtual int position() const { return pos_; } | 1879 virtual int position() const { return pos_; } |
| 1888 | 1880 |
| 1889 BailoutId RightId() const { return right_id_; } | 1881 BailoutId RightId() const { return right_id_; } |
| 1890 | 1882 |
| 1891 TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); } | 1883 TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); } |
| 1892 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1884 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| 1893 TypeInfo left_type() const { return left_type_; } | 1885 Handle<Type> left_type() const { return left_type_; } |
| 1894 TypeInfo right_type() const { return right_type_; } | 1886 Handle<Type> right_type() const { return right_type_; } |
| 1895 TypeInfo result_type() const { return result_type_; } | 1887 Handle<Type> result_type() const { return result_type_; } |
| 1896 bool has_fixed_right_arg() const { return has_fixed_right_arg_; } | 1888 bool has_fixed_right_arg() const { return has_fixed_right_arg_; } |
| 1897 int fixed_right_arg_value() const { return fixed_right_arg_value_; } | 1889 int fixed_right_arg_value() const { return fixed_right_arg_value_; } |
| 1898 | 1890 |
| 1899 protected: | 1891 protected: |
| 1900 BinaryOperation(Isolate* isolate, | 1892 BinaryOperation(Isolate* isolate, |
| 1901 Token::Value op, | 1893 Token::Value op, |
| 1902 Expression* left, | 1894 Expression* left, |
| 1903 Expression* right, | 1895 Expression* right, |
| 1904 int pos) | 1896 int pos) |
| 1905 : Expression(isolate), | 1897 : Expression(isolate), |
| 1906 op_(op), | 1898 op_(op), |
| 1907 left_(left), | 1899 left_(left), |
| 1908 right_(right), | 1900 right_(right), |
| 1909 pos_(pos), | 1901 pos_(pos), |
| 1910 right_id_(GetNextId(isolate)) { | 1902 right_id_(GetNextId(isolate)) { |
| 1911 ASSERT(Token::IsBinaryOp(op)); | 1903 ASSERT(Token::IsBinaryOp(op)); |
| 1912 } | 1904 } |
| 1913 | 1905 |
| 1914 private: | 1906 private: |
| 1915 Token::Value op_; | 1907 Token::Value op_; |
| 1916 Expression* left_; | 1908 Expression* left_; |
| 1917 Expression* right_; | 1909 Expression* right_; |
| 1918 int pos_; | 1910 int pos_; |
| 1919 | 1911 |
| 1920 TypeInfo left_type_; | 1912 Handle<Type> left_type_; |
| 1921 TypeInfo right_type_; | 1913 Handle<Type> right_type_; |
| 1922 TypeInfo result_type_; | 1914 Handle<Type> result_type_; |
| 1923 bool has_fixed_right_arg_; | 1915 bool has_fixed_right_arg_; |
| 1924 int fixed_right_arg_value_; | 1916 int fixed_right_arg_value_; |
| 1925 | 1917 |
| 1926 // The short-circuit logical operations need an AST ID for their | 1918 // The short-circuit logical operations need an AST ID for their |
| 1927 // right-hand subexpression. | 1919 // right-hand subexpression. |
| 1928 const BailoutId right_id_; | 1920 const BailoutId right_id_; |
| 1929 }; | 1921 }; |
| 1930 | 1922 |
| 1931 | 1923 |
| 1932 class CountOperation: public Expression { | 1924 class CountOperation: public Expression { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1996 DECLARE_NODE_TYPE(CompareOperation) | 1988 DECLARE_NODE_TYPE(CompareOperation) |
| 1997 | 1989 |
| 1998 Token::Value op() const { return op_; } | 1990 Token::Value op() const { return op_; } |
| 1999 Expression* left() const { return left_; } | 1991 Expression* left() const { return left_; } |
| 2000 Expression* right() const { return right_; } | 1992 Expression* right() const { return right_; } |
| 2001 virtual int position() const { return pos_; } | 1993 virtual int position() const { return pos_; } |
| 2002 | 1994 |
| 2003 // Type feedback information. | 1995 // Type feedback information. |
| 2004 TypeFeedbackId CompareOperationFeedbackId() const { return reuse(id()); } | 1996 TypeFeedbackId CompareOperationFeedbackId() const { return reuse(id()); } |
| 2005 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1997 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| 2006 TypeInfo left_type() const { return left_type_; } | 1998 Handle<Type> left_type() const { return left_type_; } |
| 2007 TypeInfo right_type() const { return right_type_; } | 1999 Handle<Type> right_type() const { return right_type_; } |
| 2008 TypeInfo overall_type() const { return overall_type_; } | 2000 Handle<Type> overall_type() const { return overall_type_; } |
| 2009 byte compare_nil_types() const { return compare_nil_types_; } | 2001 Handle<Type> compare_nil_type() const { return compare_nil_type_; } |
| 2010 Handle<Map> map() const { return map_; } | |
| 2011 | 2002 |
| 2012 // Match special cases. | 2003 // Match special cases. |
| 2013 bool IsLiteralCompareTypeof(Expression** expr, Handle<String>* check); | 2004 bool IsLiteralCompareTypeof(Expression** expr, Handle<String>* check); |
| 2014 bool IsLiteralCompareUndefined(Expression** expr); | 2005 bool IsLiteralCompareUndefined(Expression** expr); |
| 2015 bool IsLiteralCompareNull(Expression** expr); | 2006 bool IsLiteralCompareNull(Expression** expr); |
| 2016 | 2007 |
| 2017 protected: | 2008 protected: |
| 2018 CompareOperation(Isolate* isolate, | 2009 CompareOperation(Isolate* isolate, |
| 2019 Token::Value op, | 2010 Token::Value op, |
| 2020 Expression* left, | 2011 Expression* left, |
| 2021 Expression* right, | 2012 Expression* right, |
| 2022 int pos) | 2013 int pos) |
| 2023 : Expression(isolate), | 2014 : Expression(isolate), |
| 2024 op_(op), | 2015 op_(op), |
| 2025 left_(left), | 2016 left_(left), |
| 2026 right_(right), | 2017 right_(right), |
| 2027 pos_(pos) { | 2018 pos_(pos) { |
| 2028 ASSERT(Token::IsCompareOp(op)); | 2019 ASSERT(Token::IsCompareOp(op)); |
| 2029 } | 2020 } |
| 2030 | 2021 |
| 2031 private: | 2022 private: |
| 2032 Token::Value op_; | 2023 Token::Value op_; |
| 2033 Expression* left_; | 2024 Expression* left_; |
| 2034 Expression* right_; | 2025 Expression* right_; |
| 2035 int pos_; | 2026 int pos_; |
| 2036 | 2027 |
| 2037 TypeInfo left_type_; | 2028 Handle<Type> left_type_; |
| 2038 TypeInfo right_type_; | 2029 Handle<Type> right_type_; |
| 2039 TypeInfo overall_type_; | 2030 Handle<Type> overall_type_; |
| 2040 byte compare_nil_types_; | 2031 Handle<Type> compare_nil_type_; |
| 2041 Handle<Map> map_; | |
| 2042 }; | 2032 }; |
| 2043 | 2033 |
| 2044 | 2034 |
| 2045 class Conditional: public Expression { | 2035 class Conditional: public Expression { |
| 2046 public: | 2036 public: |
| 2047 DECLARE_NODE_TYPE(Conditional) | 2037 DECLARE_NODE_TYPE(Conditional) |
| 2048 | 2038 |
| 2049 Expression* condition() const { return condition_; } | 2039 Expression* condition() const { return condition_; } |
| 2050 Expression* then_expression() const { return then_expression_; } | 2040 Expression* then_expression() const { return then_expression_; } |
| 2051 Expression* else_expression() const { return else_expression_; } | 2041 Expression* else_expression() const { return else_expression_; } |
| (...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3228 private: | 3218 private: |
| 3229 Isolate* isolate_; | 3219 Isolate* isolate_; |
| 3230 Zone* zone_; | 3220 Zone* zone_; |
| 3231 Visitor visitor_; | 3221 Visitor visitor_; |
| 3232 }; | 3222 }; |
| 3233 | 3223 |
| 3234 | 3224 |
| 3235 } } // namespace v8::internal | 3225 } } // namespace v8::internal |
| 3236 | 3226 |
| 3237 #endif // V8_AST_H_ | 3227 #endif // V8_AST_H_ |
| OLD | NEW |