| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
| 6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
| 7 | 7 |
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/ast/ast-types.h" | 9 #include "src/ast/ast-types.h" |
| 10 #include "src/ast/ast-value-factory.h" | 10 #include "src/ast/ast-value-factory.h" |
| (...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1863 bool is_possibly_eval() const { | 1863 bool is_possibly_eval() const { |
| 1864 return IsPossiblyEvalField::decode(bit_field_); | 1864 return IsPossiblyEvalField::decode(bit_field_); |
| 1865 } | 1865 } |
| 1866 | 1866 |
| 1867 TailCallMode tail_call_mode() const { | 1867 TailCallMode tail_call_mode() const { |
| 1868 return IsTailField::decode(bit_field_) ? TailCallMode::kAllow | 1868 return IsTailField::decode(bit_field_) ? TailCallMode::kAllow |
| 1869 : TailCallMode::kDisallow; | 1869 : TailCallMode::kDisallow; |
| 1870 } | 1870 } |
| 1871 void MarkTail() { bit_field_ = IsTailField::update(bit_field_, true); } | 1871 void MarkTail() { bit_field_ = IsTailField::update(bit_field_, true); } |
| 1872 | 1872 |
| 1873 bool only_last_arg_is_spread() { |
| 1874 return !arguments_->is_empty() && arguments_->last()->IsSpread(); |
| 1875 } |
| 1876 |
| 1873 enum CallType { | 1877 enum CallType { |
| 1874 GLOBAL_CALL, | 1878 GLOBAL_CALL, |
| 1875 WITH_CALL, | 1879 WITH_CALL, |
| 1876 NAMED_PROPERTY_CALL, | 1880 NAMED_PROPERTY_CALL, |
| 1877 KEYED_PROPERTY_CALL, | 1881 KEYED_PROPERTY_CALL, |
| 1878 NAMED_SUPER_PROPERTY_CALL, | 1882 NAMED_SUPER_PROPERTY_CALL, |
| 1879 KEYED_SUPER_PROPERTY_CALL, | 1883 KEYED_SUPER_PROPERTY_CALL, |
| 1880 SUPER_CALL, | 1884 SUPER_CALL, |
| 1881 OTHER_CALL | 1885 OTHER_CALL |
| 1882 }; | 1886 }; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1962 } | 1966 } |
| 1963 void set_is_monomorphic(bool monomorphic) { | 1967 void set_is_monomorphic(bool monomorphic) { |
| 1964 bit_field_ = IsMonomorphicField::update(bit_field_, monomorphic); | 1968 bit_field_ = IsMonomorphicField::update(bit_field_, monomorphic); |
| 1965 } | 1969 } |
| 1966 void set_target(Handle<JSFunction> target) { target_ = target; } | 1970 void set_target(Handle<JSFunction> target) { target_ = target; } |
| 1967 void SetKnownGlobalTarget(Handle<JSFunction> target) { | 1971 void SetKnownGlobalTarget(Handle<JSFunction> target) { |
| 1968 target_ = target; | 1972 target_ = target; |
| 1969 set_is_monomorphic(true); | 1973 set_is_monomorphic(true); |
| 1970 } | 1974 } |
| 1971 | 1975 |
| 1976 bool only_last_arg_is_spread() { |
| 1977 return !arguments_->is_empty() && arguments_->last()->IsSpread(); |
| 1978 } |
| 1979 |
| 1972 private: | 1980 private: |
| 1973 friend class AstNodeFactory; | 1981 friend class AstNodeFactory; |
| 1974 | 1982 |
| 1975 CallNew(Expression* expression, ZoneList<Expression*>* arguments, int pos) | 1983 CallNew(Expression* expression, ZoneList<Expression*>* arguments, int pos) |
| 1976 : Expression(pos, kCallNew), | 1984 : Expression(pos, kCallNew), |
| 1977 expression_(expression), | 1985 expression_(expression), |
| 1978 arguments_(arguments) { | 1986 arguments_(arguments) { |
| 1979 bit_field_ |= IsMonomorphicField::encode(false); | 1987 bit_field_ |= IsMonomorphicField::encode(false); |
| 1980 } | 1988 } |
| 1981 | 1989 |
| (...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3621 : NULL; \ | 3629 : NULL; \ |
| 3622 } | 3630 } |
| 3623 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3631 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3624 #undef DECLARE_NODE_FUNCTIONS | 3632 #undef DECLARE_NODE_FUNCTIONS |
| 3625 | 3633 |
| 3626 | 3634 |
| 3627 } // namespace internal | 3635 } // namespace internal |
| 3628 } // namespace v8 | 3636 } // namespace v8 |
| 3629 | 3637 |
| 3630 #endif // V8_AST_AST_H_ | 3638 #endif // V8_AST_AST_H_ |
| OLD | NEW |