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