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 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 | 1929 |
1930 class BinaryOperation V8_FINAL : public Expression { | 1930 class BinaryOperation V8_FINAL : public Expression { |
1931 public: | 1931 public: |
1932 DECLARE_NODE_TYPE(BinaryOperation) | 1932 DECLARE_NODE_TYPE(BinaryOperation) |
1933 | 1933 |
1934 virtual bool ResultOverwriteAllowed(); | 1934 virtual bool ResultOverwriteAllowed(); |
1935 | 1935 |
1936 Token::Value op() const { return op_; } | 1936 Token::Value op() const { return op_; } |
1937 Expression* left() const { return left_; } | 1937 Expression* left() const { return left_; } |
1938 Expression* right() const { return right_; } | 1938 Expression* right() const { return right_; } |
1939 Handle<AllocationSite> allocation_site() const { return allocation_site_; } | |
1940 void set_allocation_site(Handle<AllocationSite> allocation_site) { | |
1941 allocation_site_ = allocation_site; | |
1942 } | |
1943 | 1939 |
1944 BailoutId RightId() const { return right_id_; } | 1940 BailoutId RightId() const { return right_id_; } |
1945 | 1941 |
1946 TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); } | 1942 TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); } |
1947 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } | 1943 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } |
1948 void set_fixed_right_arg(Maybe<int> arg) { fixed_right_arg_ = arg; } | 1944 void set_fixed_right_arg(Maybe<int> arg) { fixed_right_arg_ = arg; } |
1949 | 1945 |
1950 virtual void RecordToBooleanTypeFeedback( | 1946 virtual void RecordToBooleanTypeFeedback( |
1951 TypeFeedbackOracle* oracle) V8_OVERRIDE; | 1947 TypeFeedbackOracle* oracle) V8_OVERRIDE; |
1952 | 1948 |
1953 protected: | 1949 protected: |
1954 BinaryOperation(Isolate* isolate, | 1950 BinaryOperation(Isolate* isolate, |
1955 Token::Value op, | 1951 Token::Value op, |
1956 Expression* left, | 1952 Expression* left, |
1957 Expression* right, | 1953 Expression* right, |
1958 int pos) | 1954 int pos) |
1959 : Expression(isolate, pos), | 1955 : Expression(isolate, pos), |
1960 op_(op), | 1956 op_(op), |
1961 left_(left), | 1957 left_(left), |
1962 right_(right), | 1958 right_(right), |
1963 right_id_(GetNextId(isolate)) { | 1959 right_id_(GetNextId(isolate)) { |
1964 ASSERT(Token::IsBinaryOp(op)); | 1960 ASSERT(Token::IsBinaryOp(op)); |
1965 } | 1961 } |
1966 | 1962 |
1967 private: | 1963 private: |
1968 Token::Value op_; | 1964 Token::Value op_; |
1969 Expression* left_; | 1965 Expression* left_; |
1970 Expression* right_; | 1966 Expression* right_; |
1971 Handle<AllocationSite> allocation_site_; | |
1972 | 1967 |
1973 // TODO(rossberg): the fixed arg should probably be represented as a Constant | 1968 // TODO(rossberg): the fixed arg should probably be represented as a Constant |
1974 // type for the RHS. | 1969 // type for the RHS. |
1975 Maybe<int> fixed_right_arg_; | 1970 Maybe<int> fixed_right_arg_; |
1976 | 1971 |
1977 // The short-circuit logical operations need an AST ID for their | 1972 // The short-circuit logical operations need an AST ID for their |
1978 // right-hand subexpression. | 1973 // right-hand subexpression. |
1979 const BailoutId right_id_; | 1974 const BailoutId right_id_; |
1980 }; | 1975 }; |
1981 | 1976 |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3293 private: | 3288 private: |
3294 Isolate* isolate_; | 3289 Isolate* isolate_; |
3295 Zone* zone_; | 3290 Zone* zone_; |
3296 Visitor visitor_; | 3291 Visitor visitor_; |
3297 }; | 3292 }; |
3298 | 3293 |
3299 | 3294 |
3300 } } // namespace v8::internal | 3295 } } // namespace v8::internal |
3301 | 3296 |
3302 #endif // V8_AST_H_ | 3297 #endif // V8_AST_H_ |
OLD | NEW |