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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 case Token::VOID: | 837 case Token::VOID: |
838 ProcessExpression(expr->expression(), Expression::kEffect); | 838 ProcessExpression(expr->expression(), Expression::kEffect); |
839 break; | 839 break; |
840 default: | 840 default: |
841 BAILOUT("UnaryOperation"); | 841 BAILOUT("UnaryOperation"); |
842 } | 842 } |
843 } | 843 } |
844 | 844 |
845 | 845 |
846 void CodeGenSelector::VisitCountOperation(CountOperation* expr) { | 846 void CodeGenSelector::VisitCountOperation(CountOperation* expr) { |
847 BAILOUT("CountOperation"); | 847 // We support postfix count operations on global variables. |
| 848 if (expr->is_prefix()) BAILOUT("Prefix CountOperation"); |
| 849 Variable* var = expr->expression()->AsVariableProxy()->AsVariable(); |
| 850 if (var == NULL || !var->is_global()) BAILOUT("non-global postincrement"); |
| 851 ProcessExpression(expr->expression(), Expression::kValue); |
848 } | 852 } |
849 | 853 |
850 | 854 |
851 void CodeGenSelector::VisitBinaryOperation(BinaryOperation* expr) { | 855 void CodeGenSelector::VisitBinaryOperation(BinaryOperation* expr) { |
852 switch (expr->op()) { | 856 switch (expr->op()) { |
853 case Token::COMMA: | 857 case Token::COMMA: |
854 ProcessExpression(expr->left(), Expression::kEffect); | 858 ProcessExpression(expr->left(), Expression::kEffect); |
855 CHECK_BAILOUT; | 859 CHECK_BAILOUT; |
856 ProcessExpression(expr->right(), context_); | 860 ProcessExpression(expr->right(), context_); |
857 break; | 861 break; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 | 933 |
930 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { | 934 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { |
931 BAILOUT("ThisFunction"); | 935 BAILOUT("ThisFunction"); |
932 } | 936 } |
933 | 937 |
934 #undef BAILOUT | 938 #undef BAILOUT |
935 #undef CHECK_BAILOUT | 939 #undef CHECK_BAILOUT |
936 | 940 |
937 | 941 |
938 } } // namespace v8::internal | 942 } } // namespace v8::internal |
OLD | NEW |