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 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1945 | 1945 |
1946 virtual bool ResultOverwriteAllowed(); | 1946 virtual bool ResultOverwriteAllowed(); |
1947 | 1947 |
1948 Token::Value op() const { return op_; } | 1948 Token::Value op() const { return op_; } |
1949 Expression* left() const { return left_; } | 1949 Expression* left() const { return left_; } |
1950 Expression* right() const { return right_; } | 1950 Expression* right() const { return right_; } |
1951 | 1951 |
1952 BailoutId RightId() const { return right_id_; } | 1952 BailoutId RightId() const { return right_id_; } |
1953 | 1953 |
1954 TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); } | 1954 TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); } |
| 1955 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } |
| 1956 void set_fixed_right_arg(Maybe<int> arg) { fixed_right_arg_ = arg; } |
1955 | 1957 |
1956 virtual void RecordToBooleanTypeFeedback( | 1958 virtual void RecordToBooleanTypeFeedback( |
1957 TypeFeedbackOracle* oracle) V8_OVERRIDE; | 1959 TypeFeedbackOracle* oracle) V8_OVERRIDE; |
1958 | 1960 |
1959 protected: | 1961 protected: |
1960 BinaryOperation(Isolate* isolate, | 1962 BinaryOperation(Isolate* isolate, |
1961 Token::Value op, | 1963 Token::Value op, |
1962 Expression* left, | 1964 Expression* left, |
1963 Expression* right, | 1965 Expression* right, |
1964 int pos) | 1966 int pos) |
1965 : Expression(isolate, pos), | 1967 : Expression(isolate, pos), |
1966 op_(op), | 1968 op_(op), |
1967 left_(left), | 1969 left_(left), |
1968 right_(right), | 1970 right_(right), |
1969 right_id_(GetNextId(isolate)) { | 1971 right_id_(GetNextId(isolate)) { |
1970 ASSERT(Token::IsBinaryOp(op)); | 1972 ASSERT(Token::IsBinaryOp(op)); |
1971 } | 1973 } |
1972 | 1974 |
1973 private: | 1975 private: |
1974 Token::Value op_; | 1976 Token::Value op_; |
1975 Expression* left_; | 1977 Expression* left_; |
1976 Expression* right_; | 1978 Expression* right_; |
1977 | 1979 |
| 1980 // TODO(rossberg): the fixed arg should probably be represented as a Constant |
| 1981 // type for the RHS. |
| 1982 Maybe<int> fixed_right_arg_; |
| 1983 |
1978 // The short-circuit logical operations need an AST ID for their | 1984 // The short-circuit logical operations need an AST ID for their |
1979 // right-hand subexpression. | 1985 // right-hand subexpression. |
1980 const BailoutId right_id_; | 1986 const BailoutId right_id_; |
1981 }; | 1987 }; |
1982 | 1988 |
1983 | 1989 |
1984 class CountOperation V8_FINAL : public Expression { | 1990 class CountOperation V8_FINAL : public Expression { |
1985 public: | 1991 public: |
1986 DECLARE_NODE_TYPE(CountOperation) | 1992 DECLARE_NODE_TYPE(CountOperation) |
1987 | 1993 |
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3295 private: | 3301 private: |
3296 Isolate* isolate_; | 3302 Isolate* isolate_; |
3297 Zone* zone_; | 3303 Zone* zone_; |
3298 Visitor visitor_; | 3304 Visitor visitor_; |
3299 }; | 3305 }; |
3300 | 3306 |
3301 | 3307 |
3302 } } // namespace v8::internal | 3308 } } // namespace v8::internal |
3303 | 3309 |
3304 #endif // V8_AST_H_ | 3310 #endif // V8_AST_H_ |
OLD | NEW |