| 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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 | 821 |
| 822 void CodeGenSelector::VisitBinaryOperation(BinaryOperation* expr) { | 822 void CodeGenSelector::VisitBinaryOperation(BinaryOperation* expr) { |
| 823 switch (expr->op()) { | 823 switch (expr->op()) { |
| 824 case Token::COMMA: | 824 case Token::COMMA: |
| 825 ProcessExpression(expr->left(), Expression::kEffect); | 825 ProcessExpression(expr->left(), Expression::kEffect); |
| 826 CHECK_BAILOUT; | 826 CHECK_BAILOUT; |
| 827 ProcessExpression(expr->right(), context_); | 827 ProcessExpression(expr->right(), context_); |
| 828 break; | 828 break; |
| 829 | 829 |
| 830 case Token::OR: | 830 case Token::OR: |
| 831 ProcessExpression(expr->left(), Expression::kValue); | 831 switch (context_) { |
| 832 case Expression::kUninitialized: |
| 833 UNREACHABLE(); |
| 834 case Expression::kEffect: // Fall through. |
| 835 case Expression::kTest: // Fall through. |
| 836 case Expression::kTestValue: |
| 837 // The left subexpression's value is not needed, it is in a pure |
| 838 // test context. |
| 839 ProcessExpression(expr->left(), Expression::kTest); |
| 840 break; |
| 841 case Expression::kValue: // Fall through. |
| 842 case Expression::kValueTest: |
| 843 // The left subexpression's value is needed, it is in a hybrid |
| 844 // value/test context. |
| 845 ProcessExpression(expr->left(), Expression::kValueTest); |
| 846 break; |
| 847 } |
| 848 CHECK_BAILOUT; |
| 849 ProcessExpression(expr->right(), context_); |
| 850 break; |
| 851 |
| 852 case Token::AND: |
| 853 switch (context_) { |
| 854 case Expression::kUninitialized: |
| 855 UNREACHABLE(); |
| 856 case Expression::kEffect: // Fall through. |
| 857 case Expression::kTest: // Fall through. |
| 858 case Expression::kValueTest: |
| 859 // The left subexpression's value is not needed, it is in a pure |
| 860 // test context. |
| 861 ProcessExpression(expr->left(), Expression::kTest); |
| 862 break; |
| 863 case Expression::kValue: // Fall through. |
| 864 case Expression::kTestValue: |
| 865 // The left subexpression's value is needed, it is in a hybrid |
| 866 // test/value context. |
| 867 ProcessExpression(expr->left(), Expression::kTestValue); |
| 868 break; |
| 869 } |
| 832 CHECK_BAILOUT; | 870 CHECK_BAILOUT; |
| 833 ProcessExpression(expr->right(), context_); | 871 ProcessExpression(expr->right(), context_); |
| 834 break; | 872 break; |
| 835 | 873 |
| 836 case Token::ADD: | 874 case Token::ADD: |
| 837 case Token::SUB: | 875 case Token::SUB: |
| 838 case Token::DIV: | 876 case Token::DIV: |
| 839 case Token::MOD: | 877 case Token::MOD: |
| 840 case Token::MUL: | 878 case Token::MUL: |
| 841 case Token::BIT_OR: | 879 case Token::BIT_OR: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 862 | 900 |
| 863 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { | 901 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { |
| 864 BAILOUT("ThisFunction"); | 902 BAILOUT("ThisFunction"); |
| 865 } | 903 } |
| 866 | 904 |
| 867 #undef BAILOUT | 905 #undef BAILOUT |
| 868 #undef CHECK_BAILOUT | 906 #undef CHECK_BAILOUT |
| 869 | 907 |
| 870 | 908 |
| 871 } } // namespace v8::internal | 909 } } // namespace v8::internal |
| OLD | NEW |