| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3798 | 3798 |
| 3799 void HOptimizedGraphBuilder::VisitExpressions( | 3799 void HOptimizedGraphBuilder::VisitExpressions( |
| 3800 ZoneList<Expression*>* exprs) { | 3800 ZoneList<Expression*>* exprs) { |
| 3801 for (int i = 0; i < exprs->length(); ++i) { | 3801 for (int i = 0; i < exprs->length(); ++i) { |
| 3802 CHECK_ALIVE(VisitForValue(exprs->at(i))); | 3802 CHECK_ALIVE(VisitForValue(exprs->at(i))); |
| 3803 } | 3803 } |
| 3804 } | 3804 } |
| 3805 | 3805 |
| 3806 | 3806 |
| 3807 bool HOptimizedGraphBuilder::BuildGraph() { | 3807 bool HOptimizedGraphBuilder::BuildGraph() { |
| 3808 if (info()->function()->is_generator()) { |
| 3809 Bailout("function is a generator"); |
| 3810 return false; |
| 3811 } |
| 3808 Scope* scope = info()->scope(); | 3812 Scope* scope = info()->scope(); |
| 3809 if (scope->HasIllegalRedeclaration()) { | 3813 if (scope->HasIllegalRedeclaration()) { |
| 3810 Bailout("function with illegal redeclaration"); | 3814 Bailout("function with illegal redeclaration"); |
| 3811 return false; | 3815 return false; |
| 3812 } | 3816 } |
| 3813 if (scope->calls_eval()) { | 3817 if (scope->calls_eval()) { |
| 3814 Bailout("function calls eval"); | 3818 Bailout("function calls eval"); |
| 3815 return false; | 3819 return false; |
| 3816 } | 3820 } |
| 3817 SetUpScope(scope); | 3821 SetUpScope(scope); |
| (...skipping 2840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6658 | 6662 |
| 6659 case Variable::LOOKUP: | 6663 case Variable::LOOKUP: |
| 6660 return Bailout("assignment to LOOKUP variable"); | 6664 return Bailout("assignment to LOOKUP variable"); |
| 6661 } | 6665 } |
| 6662 } else { | 6666 } else { |
| 6663 return Bailout("invalid left-hand side in assignment"); | 6667 return Bailout("invalid left-hand side in assignment"); |
| 6664 } | 6668 } |
| 6665 } | 6669 } |
| 6666 | 6670 |
| 6667 | 6671 |
| 6672 void HOptimizedGraphBuilder::VisitYield(Yield* expr) { |
| 6673 // Generators are not optimized, so we should never get here. |
| 6674 UNREACHABLE(); |
| 6675 } |
| 6676 |
| 6677 |
| 6668 void HOptimizedGraphBuilder::VisitThrow(Throw* expr) { | 6678 void HOptimizedGraphBuilder::VisitThrow(Throw* expr) { |
| 6669 ASSERT(!HasStackOverflow()); | 6679 ASSERT(!HasStackOverflow()); |
| 6670 ASSERT(current_block() != NULL); | 6680 ASSERT(current_block() != NULL); |
| 6671 ASSERT(current_block()->HasPredecessor()); | 6681 ASSERT(current_block()->HasPredecessor()); |
| 6672 // We don't optimize functions with invalid left-hand sides in | 6682 // We don't optimize functions with invalid left-hand sides in |
| 6673 // assignments, count operations, or for-in. Consequently throw can | 6683 // assignments, count operations, or for-in. Consequently throw can |
| 6674 // currently only occur in an effect context. | 6684 // currently only occur in an effect context. |
| 6675 ASSERT(ast_context()->IsEffect()); | 6685 ASSERT(ast_context()->IsEffect()); |
| 6676 CHECK_ALIVE(VisitForValue(expr->exception())); | 6686 CHECK_ALIVE(VisitForValue(expr->exception())); |
| 6677 | 6687 |
| (...skipping 4198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10876 } | 10886 } |
| 10877 } | 10887 } |
| 10878 | 10888 |
| 10879 #ifdef DEBUG | 10889 #ifdef DEBUG |
| 10880 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10890 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 10881 if (allocator_ != NULL) allocator_->Verify(); | 10891 if (allocator_ != NULL) allocator_->Verify(); |
| 10882 #endif | 10892 #endif |
| 10883 } | 10893 } |
| 10884 | 10894 |
| 10885 } } // namespace v8::internal | 10895 } } // namespace v8::internal |
| OLD | NEW |