| 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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 : name_(name), | 1124 : name_(name), |
| 1125 scope_(scope), | 1125 scope_(scope), |
| 1126 body_(body), | 1126 body_(body), |
| 1127 materialized_literal_count_(materialized_literal_count), | 1127 materialized_literal_count_(materialized_literal_count), |
| 1128 contains_array_literal_(contains_array_literal), | 1128 contains_array_literal_(contains_array_literal), |
| 1129 expected_property_count_(expected_property_count), | 1129 expected_property_count_(expected_property_count), |
| 1130 num_parameters_(num_parameters), | 1130 num_parameters_(num_parameters), |
| 1131 start_position_(start_position), | 1131 start_position_(start_position), |
| 1132 end_position_(end_position), | 1132 end_position_(end_position), |
| 1133 is_expression_(is_expression), | 1133 is_expression_(is_expression), |
| 1134 loop_nesting_(0), |
| 1134 function_token_position_(RelocInfo::kNoPosition) { | 1135 function_token_position_(RelocInfo::kNoPosition) { |
| 1135 } | 1136 } |
| 1136 | 1137 |
| 1137 virtual void Accept(Visitor* v); | 1138 virtual void Accept(Visitor* v); |
| 1138 | 1139 |
| 1139 // Type testing & conversion | 1140 // Type testing & conversion |
| 1140 virtual FunctionLiteral* AsFunctionLiteral() { return this; } | 1141 virtual FunctionLiteral* AsFunctionLiteral() { return this; } |
| 1141 | 1142 |
| 1142 Handle<String> name() const { return name_; } | 1143 Handle<String> name() const { return name_; } |
| 1143 Scope* scope() const { return scope_; } | 1144 Scope* scope() const { return scope_; } |
| 1144 ZoneList<Statement*>* body() const { return body_; } | 1145 ZoneList<Statement*>* body() const { return body_; } |
| 1145 void set_function_token_position(int pos) { function_token_position_ = pos; } | 1146 void set_function_token_position(int pos) { function_token_position_ = pos; } |
| 1146 int function_token_position() const { return function_token_position_; } | 1147 int function_token_position() const { return function_token_position_; } |
| 1147 int start_position() const { return start_position_; } | 1148 int start_position() const { return start_position_; } |
| 1148 int end_position() const { return end_position_; } | 1149 int end_position() const { return end_position_; } |
| 1149 bool is_expression() const { return is_expression_; } | 1150 bool is_expression() const { return is_expression_; } |
| 1150 | 1151 |
| 1151 int materialized_literal_count() { return materialized_literal_count_; } | 1152 int materialized_literal_count() { return materialized_literal_count_; } |
| 1152 bool contains_array_literal() { return contains_array_literal_; } | 1153 bool contains_array_literal() { return contains_array_literal_; } |
| 1153 int expected_property_count() { return expected_property_count_; } | 1154 int expected_property_count() { return expected_property_count_; } |
| 1154 int num_parameters() { return num_parameters_; } | 1155 int num_parameters() { return num_parameters_; } |
| 1155 | 1156 |
| 1156 bool AllowsLazyCompilation(); | 1157 bool AllowsLazyCompilation(); |
| 1157 | 1158 |
| 1159 bool loop_nesting() const { return loop_nesting_; } |
| 1160 void set_loop_nesting(int nesting) { loop_nesting_ = nesting; } |
| 1161 |
| 1158 private: | 1162 private: |
| 1159 Handle<String> name_; | 1163 Handle<String> name_; |
| 1160 Scope* scope_; | 1164 Scope* scope_; |
| 1161 ZoneList<Statement*>* body_; | 1165 ZoneList<Statement*>* body_; |
| 1162 int materialized_literal_count_; | 1166 int materialized_literal_count_; |
| 1163 bool contains_array_literal_; | 1167 bool contains_array_literal_; |
| 1164 int expected_property_count_; | 1168 int expected_property_count_; |
| 1165 int num_parameters_; | 1169 int num_parameters_; |
| 1166 int start_position_; | 1170 int start_position_; |
| 1167 int end_position_; | 1171 int end_position_; |
| 1168 bool is_expression_; | 1172 bool is_expression_; |
| 1173 int loop_nesting_; |
| 1169 int function_token_position_; | 1174 int function_token_position_; |
| 1170 }; | 1175 }; |
| 1171 | 1176 |
| 1172 | 1177 |
| 1173 class FunctionBoilerplateLiteral: public Expression { | 1178 class FunctionBoilerplateLiteral: public Expression { |
| 1174 public: | 1179 public: |
| 1175 explicit FunctionBoilerplateLiteral(Handle<JSFunction> boilerplate) | 1180 explicit FunctionBoilerplateLiteral(Handle<JSFunction> boilerplate) |
| 1176 : boilerplate_(boilerplate) { | 1181 : boilerplate_(boilerplate) { |
| 1177 ASSERT(boilerplate->IsBoilerplate()); | 1182 ASSERT(boilerplate->IsBoilerplate()); |
| 1178 } | 1183 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 #undef DEF_VISIT | 1235 #undef DEF_VISIT |
| 1231 | 1236 |
| 1232 private: | 1237 private: |
| 1233 bool stack_overflow_; | 1238 bool stack_overflow_; |
| 1234 }; | 1239 }; |
| 1235 | 1240 |
| 1236 | 1241 |
| 1237 } } // namespace v8::internal | 1242 } } // namespace v8::internal |
| 1238 | 1243 |
| 1239 #endif // V8_AST_H_ | 1244 #endif // V8_AST_H_ |
| OLD | NEW |