| 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 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1975 SUSPEND, // A normal yield: { value: EXPRESSION, done: false } | 1975 SUSPEND, // A normal yield: { value: EXPRESSION, done: false } |
| 1976 DELEGATING, // A yield*. | 1976 DELEGATING, // A yield*. |
| 1977 FINAL // A return: { value: EXPRESSION, done: true } | 1977 FINAL // A return: { value: EXPRESSION, done: true } |
| 1978 }; | 1978 }; |
| 1979 | 1979 |
| 1980 Expression* generator_object() const { return generator_object_; } | 1980 Expression* generator_object() const { return generator_object_; } |
| 1981 Expression* expression() const { return expression_; } | 1981 Expression* expression() const { return expression_; } |
| 1982 Kind yield_kind() const { return yield_kind_; } | 1982 Kind yield_kind() const { return yield_kind_; } |
| 1983 virtual int position() const { return pos_; } | 1983 virtual int position() const { return pos_; } |
| 1984 | 1984 |
| 1985 // Delegating yield surrounds the "yield" in a "try/catch". This index |
| 1986 // locates the catch handler in the handler table, and is equivalent to |
| 1987 // TryCatchStatement::index(). |
| 1988 int index() const { |
| 1989 ASSERT(yield_kind() == DELEGATING); |
| 1990 return index_; |
| 1991 } |
| 1992 void set_index(int index) { |
| 1993 ASSERT(yield_kind() == DELEGATING); |
| 1994 index_ = index; |
| 1995 } |
| 1996 |
| 1985 protected: | 1997 protected: |
| 1986 Yield(Isolate* isolate, | 1998 Yield(Isolate* isolate, |
| 1987 Expression* generator_object, | 1999 Expression* generator_object, |
| 1988 Expression* expression, | 2000 Expression* expression, |
| 1989 Kind yield_kind, | 2001 Kind yield_kind, |
| 1990 int pos) | 2002 int pos) |
| 1991 : Expression(isolate), | 2003 : Expression(isolate), |
| 1992 generator_object_(generator_object), | 2004 generator_object_(generator_object), |
| 1993 expression_(expression), | 2005 expression_(expression), |
| 1994 yield_kind_(yield_kind), | 2006 yield_kind_(yield_kind), |
| 2007 index_(-1), |
| 1995 pos_(pos) { } | 2008 pos_(pos) { } |
| 1996 | 2009 |
| 1997 private: | 2010 private: |
| 1998 Expression* generator_object_; | 2011 Expression* generator_object_; |
| 1999 Expression* expression_; | 2012 Expression* expression_; |
| 2000 Kind yield_kind_; | 2013 Kind yield_kind_; |
| 2014 int index_; |
| 2001 int pos_; | 2015 int pos_; |
| 2002 }; | 2016 }; |
| 2003 | 2017 |
| 2004 | 2018 |
| 2005 class Throw: public Expression { | 2019 class Throw: public Expression { |
| 2006 public: | 2020 public: |
| 2007 DECLARE_NODE_TYPE(Throw) | 2021 DECLARE_NODE_TYPE(Throw) |
| 2008 | 2022 |
| 2009 Expression* exception() const { return exception_; } | 2023 Expression* exception() const { return exception_; } |
| 2010 virtual int position() const { return pos_; } | 2024 virtual int position() const { return pos_; } |
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3038 private: | 3052 private: |
| 3039 Isolate* isolate_; | 3053 Isolate* isolate_; |
| 3040 Zone* zone_; | 3054 Zone* zone_; |
| 3041 Visitor visitor_; | 3055 Visitor visitor_; |
| 3042 }; | 3056 }; |
| 3043 | 3057 |
| 3044 | 3058 |
| 3045 } } // namespace v8::internal | 3059 } } // namespace v8::internal |
| 3046 | 3060 |
| 3047 #endif // V8_AST_H_ | 3061 #endif // V8_AST_H_ |
| OLD | NEW |