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 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 bool is_possibly_eval() const { | 1893 bool is_possibly_eval() const { |
1894 return IsPossiblyEvalField::decode(bit_field_); | 1894 return IsPossiblyEvalField::decode(bit_field_); |
1895 } | 1895 } |
1896 | 1896 |
1897 TailCallMode tail_call_mode() const { | 1897 TailCallMode tail_call_mode() const { |
1898 return IsTailField::decode(bit_field_) ? TailCallMode::kAllow | 1898 return IsTailField::decode(bit_field_) ? TailCallMode::kAllow |
1899 : TailCallMode::kDisallow; | 1899 : TailCallMode::kDisallow; |
1900 } | 1900 } |
1901 void MarkTail() { bit_field_ = IsTailField::update(bit_field_, true); } | 1901 void MarkTail() { bit_field_ = IsTailField::update(bit_field_, true); } |
1902 | 1902 |
| 1903 bool only_last_arg_is_spread() { |
| 1904 return !arguments_->is_empty() && arguments_->last()->IsSpread(); |
| 1905 } |
| 1906 |
1903 enum CallType { | 1907 enum CallType { |
1904 GLOBAL_CALL, | 1908 GLOBAL_CALL, |
1905 WITH_CALL, | 1909 WITH_CALL, |
1906 NAMED_PROPERTY_CALL, | 1910 NAMED_PROPERTY_CALL, |
1907 KEYED_PROPERTY_CALL, | 1911 KEYED_PROPERTY_CALL, |
1908 NAMED_SUPER_PROPERTY_CALL, | 1912 NAMED_SUPER_PROPERTY_CALL, |
1909 KEYED_SUPER_PROPERTY_CALL, | 1913 KEYED_SUPER_PROPERTY_CALL, |
1910 SUPER_CALL, | 1914 SUPER_CALL, |
1911 OTHER_CALL | 1915 OTHER_CALL |
1912 }; | 1916 }; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1992 } | 1996 } |
1993 void set_is_monomorphic(bool monomorphic) { | 1997 void set_is_monomorphic(bool monomorphic) { |
1994 bit_field_ = IsMonomorphicField::update(bit_field_, monomorphic); | 1998 bit_field_ = IsMonomorphicField::update(bit_field_, monomorphic); |
1995 } | 1999 } |
1996 void set_target(Handle<JSFunction> target) { target_ = target; } | 2000 void set_target(Handle<JSFunction> target) { target_ = target; } |
1997 void SetKnownGlobalTarget(Handle<JSFunction> target) { | 2001 void SetKnownGlobalTarget(Handle<JSFunction> target) { |
1998 target_ = target; | 2002 target_ = target; |
1999 set_is_monomorphic(true); | 2003 set_is_monomorphic(true); |
2000 } | 2004 } |
2001 | 2005 |
| 2006 bool only_last_arg_is_spread() { |
| 2007 return !arguments_->is_empty() && arguments_->last()->IsSpread(); |
| 2008 } |
| 2009 |
2002 private: | 2010 private: |
2003 friend class AstNodeFactory; | 2011 friend class AstNodeFactory; |
2004 | 2012 |
2005 CallNew(Expression* expression, ZoneList<Expression*>* arguments, int pos) | 2013 CallNew(Expression* expression, ZoneList<Expression*>* arguments, int pos) |
2006 : Expression(pos, kCallNew), | 2014 : Expression(pos, kCallNew), |
2007 expression_(expression), | 2015 expression_(expression), |
2008 arguments_(arguments) { | 2016 arguments_(arguments) { |
2009 bit_field_ |= IsMonomorphicField::encode(false); | 2017 bit_field_ |= IsMonomorphicField::encode(false); |
2010 } | 2018 } |
2011 | 2019 |
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3648 : NULL; \ | 3656 : NULL; \ |
3649 } | 3657 } |
3650 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3658 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3651 #undef DECLARE_NODE_FUNCTIONS | 3659 #undef DECLARE_NODE_FUNCTIONS |
3652 | 3660 |
3653 | 3661 |
3654 } // namespace internal | 3662 } // namespace internal |
3655 } // namespace v8 | 3663 } // namespace v8 |
3656 | 3664 |
3657 #endif // V8_AST_AST_H_ | 3665 #endif // V8_AST_AST_H_ |
OLD | NEW |