| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 int pos_; | 947 int pos_; |
| 948 Type type_; | 948 Type type_; |
| 949 | 949 |
| 950 // Dummy property used during preparsing. | 950 // Dummy property used during preparsing. |
| 951 static Property this_property_; | 951 static Property this_property_; |
| 952 }; | 952 }; |
| 953 | 953 |
| 954 | 954 |
| 955 class Call: public Expression { | 955 class Call: public Expression { |
| 956 public: | 956 public: |
| 957 Call(Expression* expression, | 957 Call(Expression* expression, ZoneList<Expression*>* arguments, int pos) |
| 958 ZoneList<Expression*>* arguments, | 958 : expression_(expression), arguments_(arguments), pos_(pos) { } |
| 959 int pos) | |
| 960 : expression_(expression), | |
| 961 arguments_(arguments), | |
| 962 pos_(pos) { } | |
| 963 | 959 |
| 964 virtual void Accept(AstVisitor* v); | 960 virtual void Accept(AstVisitor* v); |
| 965 | 961 |
| 966 // Type testing and conversion. | 962 // Type testing and conversion. |
| 967 virtual Call* AsCall() { return this; } | 963 virtual Call* AsCall() { return this; } |
| 968 | 964 |
| 969 Expression* expression() const { return expression_; } | 965 Expression* expression() const { return expression_; } |
| 970 ZoneList<Expression*>* arguments() const { return arguments_; } | 966 ZoneList<Expression*>* arguments() const { return arguments_; } |
| 971 int position() { return pos_; } | 967 int position() { return pos_; } |
| 972 | 968 |
| 973 static Call* sentinel() { return &sentinel_; } | 969 static Call* sentinel() { return &sentinel_; } |
| 974 | 970 |
| 975 private: | 971 private: |
| 976 Expression* expression_; | 972 Expression* expression_; |
| 977 ZoneList<Expression*>* arguments_; | 973 ZoneList<Expression*>* arguments_; |
| 978 int pos_; | 974 int pos_; |
| 979 | 975 |
| 980 static Call sentinel_; | 976 static Call sentinel_; |
| 981 }; | 977 }; |
| 982 | 978 |
| 983 | 979 |
| 984 class CallNew: public Call { | 980 class CallNew: public Expression { |
| 985 public: | 981 public: |
| 986 CallNew(Expression* expression, ZoneList<Expression*>* arguments, int pos) | 982 CallNew(Expression* expression, ZoneList<Expression*>* arguments, int pos) |
| 987 : Call(expression, arguments, pos) { } | 983 : expression_(expression), arguments_(arguments), pos_(pos) { } |
| 988 | 984 |
| 989 virtual void Accept(AstVisitor* v); | 985 virtual void Accept(AstVisitor* v); |
| 986 |
| 987 Expression* expression() const { return expression_; } |
| 988 ZoneList<Expression*>* arguments() const { return arguments_; } |
| 989 int position() { return pos_; } |
| 990 |
| 991 private: |
| 992 Expression* expression_; |
| 993 ZoneList<Expression*>* arguments_; |
| 994 int pos_; |
| 990 }; | 995 }; |
| 991 | 996 |
| 992 | 997 |
| 993 // The CallRuntime class does not represent any official JavaScript | 998 // The CallRuntime class does not represent any official JavaScript |
| 994 // language construct. Instead it is used to call a C or JS function | 999 // language construct. Instead it is used to call a C or JS function |
| 995 // with a set of arguments. This is used from the builtins that are | 1000 // with a set of arguments. This is used from the builtins that are |
| 996 // implemented in JavaScript (see "v8natives.js"). | 1001 // implemented in JavaScript (see "v8natives.js"). |
| 997 class CallRuntime: public Expression { | 1002 class CallRuntime: public Expression { |
| 998 public: | 1003 public: |
| 999 CallRuntime(Handle<String> name, | 1004 CallRuntime(Handle<String> name, |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 #undef DEF_VISIT | 1715 #undef DEF_VISIT |
| 1711 | 1716 |
| 1712 private: | 1717 private: |
| 1713 bool stack_overflow_; | 1718 bool stack_overflow_; |
| 1714 }; | 1719 }; |
| 1715 | 1720 |
| 1716 | 1721 |
| 1717 } } // namespace v8::internal | 1722 } } // namespace v8::internal |
| 1718 | 1723 |
| 1719 #endif // V8_AST_H_ | 1724 #endif // V8_AST_H_ |
| OLD | NEW |