OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 449 |
450 CodeGenSelector::CodeGenTag CodeGenSelector::Select(FunctionLiteral* fun) { | 450 CodeGenSelector::CodeGenTag CodeGenSelector::Select(FunctionLiteral* fun) { |
451 Scope* scope = fun->scope(); | 451 Scope* scope = fun->scope(); |
452 | 452 |
453 if (!scope->is_global_scope()) return NORMAL; | 453 if (!scope->is_global_scope()) return NORMAL; |
454 ASSERT(scope->num_heap_slots() == 0); | 454 ASSERT(scope->num_heap_slots() == 0); |
455 ASSERT(scope->arguments() == NULL); | 455 ASSERT(scope->arguments() == NULL); |
456 | 456 |
457 if (!scope->declarations()->is_empty()) return NORMAL; | 457 if (!scope->declarations()->is_empty()) return NORMAL; |
458 if (fun->materialized_literal_count() > 0) return NORMAL; | 458 if (fun->materialized_literal_count() > 0) return NORMAL; |
459 if (fun->body()->is_empty()) return NORMAL; | |
460 | 459 |
461 has_supported_syntax_ = true; | 460 has_supported_syntax_ = true; |
462 VisitStatements(fun->body()); | 461 VisitStatements(fun->body()); |
463 return has_supported_syntax_ ? FAST : NORMAL; | 462 return has_supported_syntax_ ? FAST : NORMAL; |
464 } | 463 } |
465 | 464 |
466 | 465 |
467 #define BAILOUT(reason) \ | 466 #define BAILOUT(reason) \ |
468 do { \ | 467 do { \ |
469 if (FLAG_trace_bailout) { \ | 468 if (FLAG_trace_bailout) { \ |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 | 708 |
710 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { | 709 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { |
711 BAILOUT("ThisFunction"); | 710 BAILOUT("ThisFunction"); |
712 } | 711 } |
713 | 712 |
714 #undef BAILOUT | 713 #undef BAILOUT |
715 #undef CHECK_BAILOUT | 714 #undef CHECK_BAILOUT |
716 | 715 |
717 | 716 |
718 } } // namespace v8::internal | 717 } } // namespace v8::internal |
OLD | NEW |