Chromium Code Reviews| 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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 591 for (int i = 0, len = scope->num_parameters(); i < len; i++) { | 591 for (int i = 0, len = scope->num_parameters(); i < len; i++) { |
| 592 Slot* slot = scope->parameter(i)->slot(); | 592 Slot* slot = scope->parameter(i)->slot(); |
| 593 if (slot != NULL && slot->type() == Slot::CONTEXT) { | 593 if (slot != NULL && slot->type() == Slot::CONTEXT) { |
| 594 if (FLAG_trace_bailout) { | 594 if (FLAG_trace_bailout) { |
| 595 PrintF("function has context-allocated parameters"); | 595 PrintF("function has context-allocated parameters"); |
| 596 } | 596 } |
| 597 return NORMAL; | 597 return NORMAL; |
| 598 } | 598 } |
| 599 } | 599 } |
| 600 } | 600 } |
| 601 | 601 |
|
fschneider
2009/11/13 12:49:32
Should we also bailout here?
if (scope->argumen
Lasse Reichstein
2009/11/13 13:06:12
We should, yes. Well spotted.
| |
| 602 has_supported_syntax_ = true; | 602 has_supported_syntax_ = true; |
| 603 VisitDeclarations(scope->declarations()); | 603 VisitDeclarations(scope->declarations()); |
| 604 if (!has_supported_syntax_) return NORMAL; | 604 if (!has_supported_syntax_) return NORMAL; |
| 605 | 605 |
| 606 VisitStatements(fun->body()); | 606 VisitStatements(fun->body()); |
| 607 return has_supported_syntax_ ? FAST : NORMAL; | 607 return has_supported_syntax_ ? FAST : NORMAL; |
| 608 } | 608 } |
| 609 | 609 |
| 610 | 610 |
| 611 #define BAILOUT(reason) \ | 611 #define BAILOUT(reason) \ |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 752 BAILOUT("TryFinallyStatement"); | 752 BAILOUT("TryFinallyStatement"); |
| 753 } | 753 } |
| 754 | 754 |
| 755 | 755 |
| 756 void CodeGenSelector::VisitDebuggerStatement(DebuggerStatement* stmt) { | 756 void CodeGenSelector::VisitDebuggerStatement(DebuggerStatement* stmt) { |
| 757 // Debugger statement is supported. | 757 // Debugger statement is supported. |
| 758 } | 758 } |
| 759 | 759 |
| 760 | 760 |
| 761 void CodeGenSelector::VisitFunctionLiteral(FunctionLiteral* expr) { | 761 void CodeGenSelector::VisitFunctionLiteral(FunctionLiteral* expr) { |
| 762 if (expr->scope()->arguments() != NULL) { | |
| 763 BAILOUT("FunctionLiteral uses arguments"); | |
| 764 } | |
|
Lasse Reichstein
2009/11/13 13:06:12
And removed this. The first location was the corre
| |
| 762 if (!expr->AllowsLazyCompilation()) { | 765 if (!expr->AllowsLazyCompilation()) { |
| 763 BAILOUT("FunctionLiteral does not allow lazy compilation"); | 766 BAILOUT("FunctionLiteral does not allow lazy compilation"); |
| 764 } | 767 } |
| 765 } | 768 } |
| 766 | 769 |
| 767 | 770 |
| 768 void CodeGenSelector::VisitFunctionBoilerplateLiteral( | 771 void CodeGenSelector::VisitFunctionBoilerplateLiteral( |
| 769 FunctionBoilerplateLiteral* expr) { | 772 FunctionBoilerplateLiteral* expr) { |
| 770 BAILOUT("FunctionBoilerplateLiteral"); | 773 BAILOUT("FunctionBoilerplateLiteral"); |
| 771 } | 774 } |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 792 // Non-global. | 795 // Non-global. |
| 793 Slot* slot = rewrite->AsSlot(); | 796 Slot* slot = rewrite->AsSlot(); |
| 794 if (slot != NULL) { | 797 if (slot != NULL) { |
| 795 Slot::Type type = slot->type(); | 798 Slot::Type type = slot->type(); |
| 796 // When LOOKUP slots are enabled, some currently dead code | 799 // When LOOKUP slots are enabled, some currently dead code |
| 797 // implementing unary typeof will become live. | 800 // implementing unary typeof will become live. |
| 798 if (type == Slot::LOOKUP) { | 801 if (type == Slot::LOOKUP) { |
| 799 BAILOUT("Lookup slot"); | 802 BAILOUT("Lookup slot"); |
| 800 } | 803 } |
| 801 } else { | 804 } else { |
| 802 Property* property = rewrite->AsProperty(); | 805 BAILOUT("non-global/non-slot variable reference"); |
|
fschneider
2009/11/13 12:49:32
Are there any other cases than argument access her
Lasse Reichstein
2009/11/13 13:06:12
Not currently, AFAIK.
This is what it said before
| |
| 803 // In the presence of an arguments object, parameter variables | |
| 804 // are rewritten into property accesses on that object. | |
| 805 ASSERT_NOT_NULL(property); | |
| 806 ASSERT_NE(Expression::kUninitialized, context_); | |
| 807 Visit(property); | |
| 808 property->set_context(context_); | |
| 809 } | 806 } |
| 810 } | 807 } |
| 811 } | 808 } |
| 812 | 809 |
| 813 | 810 |
| 814 void CodeGenSelector::VisitLiteral(Literal* expr) { | 811 void CodeGenSelector::VisitLiteral(Literal* expr) { |
| 815 /* Nothing to do. */ | 812 /* Nothing to do. */ |
| 816 } | 813 } |
| 817 | 814 |
| 818 | 815 |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1106 | 1103 |
| 1107 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { | 1104 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { |
| 1108 BAILOUT("ThisFunction"); | 1105 BAILOUT("ThisFunction"); |
| 1109 } | 1106 } |
| 1110 | 1107 |
| 1111 #undef BAILOUT | 1108 #undef BAILOUT |
| 1112 #undef CHECK_BAILOUT | 1109 #undef CHECK_BAILOUT |
| 1113 | 1110 |
| 1114 | 1111 |
| 1115 } } // namespace v8::internal | 1112 } } // namespace v8::internal |
| OLD | NEW |