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; } | |
1957 | 1955 |
1958 virtual void RecordToBooleanTypeFeedback( | 1956 virtual void RecordToBooleanTypeFeedback( |
1959 TypeFeedbackOracle* oracle) V8_OVERRIDE; | 1957 TypeFeedbackOracle* oracle) V8_OVERRIDE; |
1960 | 1958 |
1961 protected: | 1959 protected: |
1962 BinaryOperation(Isolate* isolate, | 1960 BinaryOperation(Isolate* isolate, |
1963 Token::Value op, | 1961 Token::Value op, |
1964 Expression* left, | 1962 Expression* left, |
1965 Expression* right, | 1963 Expression* right, |
1966 int pos) | 1964 int pos) |
1967 : Expression(isolate, pos), | 1965 : Expression(isolate, pos), |
1968 op_(op), | 1966 op_(op), |
1969 left_(left), | 1967 left_(left), |
1970 right_(right), | 1968 right_(right), |
1971 right_id_(GetNextId(isolate)) { | 1969 right_id_(GetNextId(isolate)) { |
1972 ASSERT(Token::IsBinaryOp(op)); | 1970 ASSERT(Token::IsBinaryOp(op)); |
1973 } | 1971 } |
1974 | 1972 |
1975 private: | 1973 private: |
1976 Token::Value op_; | 1974 Token::Value op_; |
1977 Expression* left_; | 1975 Expression* left_; |
1978 Expression* right_; | 1976 Expression* right_; |
1979 | 1977 |
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 | |
1984 // The short-circuit logical operations need an AST ID for their | 1978 // The short-circuit logical operations need an AST ID for their |
1985 // right-hand subexpression. | 1979 // right-hand subexpression. |
1986 const BailoutId right_id_; | 1980 const BailoutId right_id_; |
1987 }; | 1981 }; |
1988 | 1982 |
1989 | 1983 |
1990 class CountOperation V8_FINAL : public Expression { | 1984 class CountOperation V8_FINAL : public Expression { |
1991 public: | 1985 public: |
1992 DECLARE_NODE_TYPE(CountOperation) | 1986 DECLARE_NODE_TYPE(CountOperation) |
1993 | 1987 |
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3301 private: | 3295 private: |
3302 Isolate* isolate_; | 3296 Isolate* isolate_; |
3303 Zone* zone_; | 3297 Zone* zone_; |
3304 Visitor visitor_; | 3298 Visitor visitor_; |
3305 }; | 3299 }; |
3306 | 3300 |
3307 | 3301 |
3308 } } // namespace v8::internal | 3302 } } // namespace v8::internal |
3309 | 3303 |
3310 #endif // V8_AST_H_ | 3304 #endif // V8_AST_H_ |
OLD | NEW |