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 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1877 virtual bool ResultOverwriteAllowed(); | 1877 virtual bool ResultOverwriteAllowed(); |
1878 | 1878 |
1879 Token::Value op() const { return op_; } | 1879 Token::Value op() const { return op_; } |
1880 Expression* left() const { return left_; } | 1880 Expression* left() const { return left_; } |
1881 Expression* right() const { return right_; } | 1881 Expression* right() const { return right_; } |
1882 virtual int position() const { return pos_; } | 1882 virtual int position() const { return pos_; } |
1883 | 1883 |
1884 BailoutId RightId() const { return right_id_; } | 1884 BailoutId RightId() const { return right_id_; } |
1885 | 1885 |
1886 TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); } | 1886 TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); } |
| 1887 // TODO(rossberg): result_type should be subsumed by lower_type. |
| 1888 Handle<Type> result_type() const { return result_type_; } |
| 1889 void set_result_type(Handle<Type> type) { result_type_ = type; } |
1887 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } | 1890 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } |
1888 void set_fixed_right_arg(Maybe<int> arg) { fixed_right_arg_ = arg; } | 1891 void set_fixed_right_arg(Maybe<int> arg) { fixed_right_arg_ = arg; } |
1889 | 1892 |
1890 virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); | 1893 virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); |
1891 | 1894 |
1892 protected: | 1895 protected: |
1893 BinaryOperation(Isolate* isolate, | 1896 BinaryOperation(Isolate* isolate, |
1894 Token::Value op, | 1897 Token::Value op, |
1895 Expression* left, | 1898 Expression* left, |
1896 Expression* right, | 1899 Expression* right, |
1897 int pos) | 1900 int pos) |
1898 : Expression(isolate), | 1901 : Expression(isolate), |
1899 op_(op), | 1902 op_(op), |
1900 left_(left), | 1903 left_(left), |
1901 right_(right), | 1904 right_(right), |
1902 pos_(pos), | 1905 pos_(pos), |
1903 right_id_(GetNextId(isolate)) { | 1906 right_id_(GetNextId(isolate)) { |
1904 ASSERT(Token::IsBinaryOp(op)); | 1907 ASSERT(Token::IsBinaryOp(op)); |
1905 } | 1908 } |
1906 | 1909 |
1907 private: | 1910 private: |
1908 Token::Value op_; | 1911 Token::Value op_; |
1909 Expression* left_; | 1912 Expression* left_; |
1910 Expression* right_; | 1913 Expression* right_; |
1911 int pos_; | 1914 int pos_; |
1912 | 1915 |
| 1916 Handle<Type> result_type_; |
1913 // TODO(rossberg): the fixed arg should probably be represented as a Constant | 1917 // TODO(rossberg): the fixed arg should probably be represented as a Constant |
1914 // type for the RHS. | 1918 // type for the RHS. |
1915 Maybe<int> fixed_right_arg_; | 1919 Maybe<int> fixed_right_arg_; |
1916 | 1920 |
1917 // The short-circuit logical operations need an AST ID for their | 1921 // The short-circuit logical operations need an AST ID for their |
1918 // right-hand subexpression. | 1922 // right-hand subexpression. |
1919 const BailoutId right_id_; | 1923 const BailoutId right_id_; |
1920 }; | 1924 }; |
1921 | 1925 |
1922 | 1926 |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3213 private: | 3217 private: |
3214 Isolate* isolate_; | 3218 Isolate* isolate_; |
3215 Zone* zone_; | 3219 Zone* zone_; |
3216 Visitor visitor_; | 3220 Visitor visitor_; |
3217 }; | 3221 }; |
3218 | 3222 |
3219 | 3223 |
3220 } } // namespace v8::internal | 3224 } } // namespace v8::internal |
3221 | 3225 |
3222 #endif // V8_AST_H_ | 3226 #endif // V8_AST_H_ |
OLD | NEW |