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 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 has_only_simple_this_property_assignments_( | 1317 has_only_simple_this_property_assignments_( |
1318 has_only_simple_this_property_assignments), | 1318 has_only_simple_this_property_assignments), |
1319 this_property_assignments_(this_property_assignments), | 1319 this_property_assignments_(this_property_assignments), |
1320 num_parameters_(num_parameters), | 1320 num_parameters_(num_parameters), |
1321 start_position_(start_position), | 1321 start_position_(start_position), |
1322 end_position_(end_position), | 1322 end_position_(end_position), |
1323 is_expression_(is_expression), | 1323 is_expression_(is_expression), |
1324 loop_nesting_(0), | 1324 loop_nesting_(0), |
1325 function_token_position_(RelocInfo::kNoPosition), | 1325 function_token_position_(RelocInfo::kNoPosition), |
1326 inferred_name_(Heap::empty_string()), | 1326 inferred_name_(Heap::empty_string()), |
1327 try_fast_codegen_(false) { | 1327 try_full_codegen_(false) { |
1328 #ifdef DEBUG | 1328 #ifdef DEBUG |
1329 already_compiled_ = false; | 1329 already_compiled_ = false; |
1330 #endif | 1330 #endif |
1331 } | 1331 } |
1332 | 1332 |
1333 virtual void Accept(AstVisitor* v); | 1333 virtual void Accept(AstVisitor* v); |
1334 | 1334 |
1335 // Type testing & conversion | 1335 // Type testing & conversion |
1336 virtual FunctionLiteral* AsFunctionLiteral() { return this; } | 1336 virtual FunctionLiteral* AsFunctionLiteral() { return this; } |
1337 | 1337 |
(...skipping 19 matching lines...) Expand all Loading... |
1357 bool AllowsLazyCompilation(); | 1357 bool AllowsLazyCompilation(); |
1358 | 1358 |
1359 bool loop_nesting() const { return loop_nesting_; } | 1359 bool loop_nesting() const { return loop_nesting_; } |
1360 void set_loop_nesting(int nesting) { loop_nesting_ = nesting; } | 1360 void set_loop_nesting(int nesting) { loop_nesting_ = nesting; } |
1361 | 1361 |
1362 Handle<String> inferred_name() const { return inferred_name_; } | 1362 Handle<String> inferred_name() const { return inferred_name_; } |
1363 void set_inferred_name(Handle<String> inferred_name) { | 1363 void set_inferred_name(Handle<String> inferred_name) { |
1364 inferred_name_ = inferred_name; | 1364 inferred_name_ = inferred_name; |
1365 } | 1365 } |
1366 | 1366 |
1367 bool try_fast_codegen() { return try_fast_codegen_; } | 1367 bool try_full_codegen() { return try_full_codegen_; } |
1368 void set_try_fast_codegen(bool flag) { try_fast_codegen_ = flag; } | 1368 void set_try_full_codegen(bool flag) { try_full_codegen_ = flag; } |
1369 | 1369 |
1370 #ifdef DEBUG | 1370 #ifdef DEBUG |
1371 void mark_as_compiled() { | 1371 void mark_as_compiled() { |
1372 ASSERT(!already_compiled_); | 1372 ASSERT(!already_compiled_); |
1373 already_compiled_ = true; | 1373 already_compiled_ = true; |
1374 } | 1374 } |
1375 #endif | 1375 #endif |
1376 | 1376 |
1377 private: | 1377 private: |
1378 Handle<String> name_; | 1378 Handle<String> name_; |
1379 Scope* scope_; | 1379 Scope* scope_; |
1380 ZoneList<Statement*>* body_; | 1380 ZoneList<Statement*>* body_; |
1381 int materialized_literal_count_; | 1381 int materialized_literal_count_; |
1382 int expected_property_count_; | 1382 int expected_property_count_; |
1383 bool has_only_simple_this_property_assignments_; | 1383 bool has_only_simple_this_property_assignments_; |
1384 Handle<FixedArray> this_property_assignments_; | 1384 Handle<FixedArray> this_property_assignments_; |
1385 int num_parameters_; | 1385 int num_parameters_; |
1386 int start_position_; | 1386 int start_position_; |
1387 int end_position_; | 1387 int end_position_; |
1388 bool is_expression_; | 1388 bool is_expression_; |
1389 int loop_nesting_; | 1389 int loop_nesting_; |
1390 int function_token_position_; | 1390 int function_token_position_; |
1391 Handle<String> inferred_name_; | 1391 Handle<String> inferred_name_; |
1392 bool try_fast_codegen_; | 1392 bool try_full_codegen_; |
1393 #ifdef DEBUG | 1393 #ifdef DEBUG |
1394 bool already_compiled_; | 1394 bool already_compiled_; |
1395 #endif | 1395 #endif |
1396 }; | 1396 }; |
1397 | 1397 |
1398 | 1398 |
1399 class FunctionBoilerplateLiteral: public Expression { | 1399 class FunctionBoilerplateLiteral: public Expression { |
1400 public: | 1400 public: |
1401 explicit FunctionBoilerplateLiteral(Handle<JSFunction> boilerplate) | 1401 explicit FunctionBoilerplateLiteral(Handle<JSFunction> boilerplate) |
1402 : boilerplate_(boilerplate) { | 1402 : boilerplate_(boilerplate) { |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 #undef DEF_VISIT | 1805 #undef DEF_VISIT |
1806 | 1806 |
1807 private: | 1807 private: |
1808 bool stack_overflow_; | 1808 bool stack_overflow_; |
1809 }; | 1809 }; |
1810 | 1810 |
1811 | 1811 |
1812 } } // namespace v8::internal | 1812 } } // namespace v8::internal |
1813 | 1813 |
1814 #endif // V8_AST_H_ | 1814 #endif // V8_AST_H_ |
OLD | NEW |