Chromium Code Reviews| 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 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1295 has_only_this_property_assignments_(has_only_this_property_assignments), | 1295 has_only_this_property_assignments_(has_only_this_property_assignments), |
| 1296 has_only_simple_this_property_assignments_( | 1296 has_only_simple_this_property_assignments_( |
| 1297 has_only_simple_this_property_assignments), | 1297 has_only_simple_this_property_assignments), |
| 1298 this_property_assignments_(this_property_assignments), | 1298 this_property_assignments_(this_property_assignments), |
| 1299 num_parameters_(num_parameters), | 1299 num_parameters_(num_parameters), |
| 1300 start_position_(start_position), | 1300 start_position_(start_position), |
| 1301 end_position_(end_position), | 1301 end_position_(end_position), |
| 1302 is_expression_(is_expression), | 1302 is_expression_(is_expression), |
| 1303 loop_nesting_(0), | 1303 loop_nesting_(0), |
| 1304 function_token_position_(RelocInfo::kNoPosition), | 1304 function_token_position_(RelocInfo::kNoPosition), |
| 1305 inferred_name_(Heap::empty_string()) { | 1305 inferred_name_(Heap::empty_string()), |
| 1306 try_fast_codegen_(false) { | |
| 1306 #ifdef DEBUG | 1307 #ifdef DEBUG |
| 1307 already_compiled_ = false; | 1308 already_compiled_ = false; |
| 1308 #endif | 1309 #endif |
| 1309 } | 1310 } |
| 1310 | 1311 |
| 1311 virtual void Accept(AstVisitor* v); | 1312 virtual void Accept(AstVisitor* v); |
| 1312 | 1313 |
| 1313 // Type testing & conversion | 1314 // Type testing & conversion |
| 1314 virtual FunctionLiteral* AsFunctionLiteral() { return this; } | 1315 virtual FunctionLiteral* AsFunctionLiteral() { return this; } |
| 1315 | 1316 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 1338 bool AllowsLazyCompilation(); | 1339 bool AllowsLazyCompilation(); |
| 1339 | 1340 |
| 1340 bool loop_nesting() const { return loop_nesting_; } | 1341 bool loop_nesting() const { return loop_nesting_; } |
| 1341 void set_loop_nesting(int nesting) { loop_nesting_ = nesting; } | 1342 void set_loop_nesting(int nesting) { loop_nesting_ = nesting; } |
| 1342 | 1343 |
| 1343 Handle<String> inferred_name() const { return inferred_name_; } | 1344 Handle<String> inferred_name() const { return inferred_name_; } |
| 1344 void set_inferred_name(Handle<String> inferred_name) { | 1345 void set_inferred_name(Handle<String> inferred_name) { |
| 1345 inferred_name_ = inferred_name; | 1346 inferred_name_ = inferred_name; |
| 1346 } | 1347 } |
| 1347 | 1348 |
| 1349 void mark_as_fast() { try_fast_codegen_ = true; } | |
| 1350 bool is_marked_as_fast() { return try_fast_codegen_; } | |
|
Søren Thygesen Gjesse
2009/11/03 13:57:47
Why not just the standard accessor names?
void
Kevin Millikin (Chromium)
2009/11/03 14:16:09
I was being too cute. I didn't see the need yet t
| |
| 1351 | |
| 1348 #ifdef DEBUG | 1352 #ifdef DEBUG |
| 1349 void mark_as_compiled() { | 1353 void mark_as_compiled() { |
| 1350 ASSERT(!already_compiled_); | 1354 ASSERT(!already_compiled_); |
| 1351 already_compiled_ = true; | 1355 already_compiled_ = true; |
| 1352 } | 1356 } |
| 1353 #endif | 1357 #endif |
| 1354 | 1358 |
| 1355 private: | 1359 private: |
| 1356 Handle<String> name_; | 1360 Handle<String> name_; |
| 1357 Scope* scope_; | 1361 Scope* scope_; |
| 1358 ZoneList<Statement*>* body_; | 1362 ZoneList<Statement*>* body_; |
| 1359 int materialized_literal_count_; | 1363 int materialized_literal_count_; |
| 1360 int expected_property_count_; | 1364 int expected_property_count_; |
| 1361 bool has_only_this_property_assignments_; | 1365 bool has_only_this_property_assignments_; |
| 1362 bool has_only_simple_this_property_assignments_; | 1366 bool has_only_simple_this_property_assignments_; |
| 1363 Handle<FixedArray> this_property_assignments_; | 1367 Handle<FixedArray> this_property_assignments_; |
| 1364 int num_parameters_; | 1368 int num_parameters_; |
| 1365 int start_position_; | 1369 int start_position_; |
| 1366 int end_position_; | 1370 int end_position_; |
| 1367 bool is_expression_; | 1371 bool is_expression_; |
| 1368 int loop_nesting_; | 1372 int loop_nesting_; |
| 1369 int function_token_position_; | 1373 int function_token_position_; |
| 1370 Handle<String> inferred_name_; | 1374 Handle<String> inferred_name_; |
| 1375 bool try_fast_codegen_; | |
| 1371 #ifdef DEBUG | 1376 #ifdef DEBUG |
| 1372 bool already_compiled_; | 1377 bool already_compiled_; |
| 1373 #endif | 1378 #endif |
| 1374 }; | 1379 }; |
| 1375 | 1380 |
| 1376 | 1381 |
| 1377 class FunctionBoilerplateLiteral: public Expression { | 1382 class FunctionBoilerplateLiteral: public Expression { |
| 1378 public: | 1383 public: |
| 1379 explicit FunctionBoilerplateLiteral(Handle<JSFunction> boilerplate) | 1384 explicit FunctionBoilerplateLiteral(Handle<JSFunction> boilerplate) |
| 1380 : boilerplate_(boilerplate) { | 1385 : boilerplate_(boilerplate) { |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1779 #undef DEF_VISIT | 1784 #undef DEF_VISIT |
| 1780 | 1785 |
| 1781 private: | 1786 private: |
| 1782 bool stack_overflow_; | 1787 bool stack_overflow_; |
| 1783 }; | 1788 }; |
| 1784 | 1789 |
| 1785 | 1790 |
| 1786 } } // namespace v8::internal | 1791 } } // namespace v8::internal |
| 1787 | 1792 |
| 1788 #endif // V8_AST_H_ | 1793 #endif // V8_AST_H_ |
| OLD | NEW |