| 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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 for (int i = 0; i < arg_count; i++) { | 722 for (int i = 0; i < arg_count; i++) { |
| 723 Visit(args->at(i)); | 723 Visit(args->at(i)); |
| 724 ASSERT_EQ(Expression::kValue, args->at(i)->context()); | 724 ASSERT_EQ(Expression::kValue, args->at(i)->context()); |
| 725 } | 725 } |
| 726 | 726 |
| 727 __ CallRuntime(function, arg_count); | 727 __ CallRuntime(function, arg_count); |
| 728 Move(expr->context(), eax); | 728 Move(expr->context(), eax); |
| 729 } | 729 } |
| 730 | 730 |
| 731 | 731 |
| 732 void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| 733 Comment cmnt(masm_, "[ UnaryOperation"); |
| 734 |
| 735 switch (expr->op()) { |
| 736 case Token::VOID: |
| 737 Visit(expr->expression()); |
| 738 ASSERT_EQ(Expression::kEffect, expr->expression()->context()); |
| 739 switch (expr->context()) { |
| 740 case Expression::kUninitialized: |
| 741 UNREACHABLE(); |
| 742 break; |
| 743 case Expression::kValue: |
| 744 __ push(Immediate(Factory::undefined_value())); |
| 745 break; |
| 746 case Expression::kEffect: |
| 747 break; |
| 748 } |
| 749 break; |
| 750 |
| 751 default: |
| 752 UNREACHABLE(); |
| 753 } |
| 754 } |
| 755 |
| 756 |
| 732 void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) { | 757 void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) { |
| 733 switch (expr->op()) { | 758 switch (expr->op()) { |
| 734 case Token::COMMA: | 759 case Token::COMMA: |
| 735 ASSERT_EQ(Expression::kEffect, expr->left()->context()); | 760 ASSERT_EQ(Expression::kEffect, expr->left()->context()); |
| 736 ASSERT_EQ(expr->context(), expr->right()->context()); | 761 ASSERT_EQ(expr->context(), expr->right()->context()); |
| 737 Visit(expr->left()); | 762 Visit(expr->left()); |
| 738 Visit(expr->right()); | 763 Visit(expr->right()); |
| 739 break; | 764 break; |
| 740 | 765 |
| 741 case Token::OR: | 766 case Token::OR: |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 } | 878 } |
| 854 // Save or discard the right-hand value as needed. | 879 // Save or discard the right-hand value as needed. |
| 855 Visit(right); | 880 Visit(right); |
| 856 ASSERT_EQ(context, right->context()); | 881 ASSERT_EQ(context, right->context()); |
| 857 | 882 |
| 858 __ bind(&done); | 883 __ bind(&done); |
| 859 } | 884 } |
| 860 | 885 |
| 861 | 886 |
| 862 } } // namespace v8::internal | 887 } } // namespace v8::internal |
| OLD | NEW |