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