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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 for (int i = 0; i < arg_count; i++) { | 734 for (int i = 0; i < arg_count; i++) { |
735 Visit(args->at(i)); | 735 Visit(args->at(i)); |
736 ASSERT_EQ(Expression::kValue, args->at(i)->context()); | 736 ASSERT_EQ(Expression::kValue, args->at(i)->context()); |
737 } | 737 } |
738 | 738 |
739 __ CallRuntime(function, arg_count); | 739 __ CallRuntime(function, arg_count); |
740 Move(expr->context(), rax); | 740 Move(expr->context(), rax); |
741 } | 741 } |
742 | 742 |
743 | 743 |
| 744 void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| 745 Comment cmnt(masm_, "[ UnaryOperation"); |
| 746 |
| 747 switch (expr->op()) { |
| 748 case Token::VOID: |
| 749 Visit(expr->expression()); |
| 750 ASSERT_EQ(Expression::kEffect, expr->expression()->context()); |
| 751 switch (expr->context()) { |
| 752 case Expression::kUninitialized: |
| 753 UNREACHABLE(); |
| 754 break; |
| 755 case Expression::kValue: |
| 756 __ PushRoot(Heap::kUndefinedValueRootIndex); |
| 757 break; |
| 758 case Expression::kEffect: |
| 759 break; |
| 760 } |
| 761 break; |
| 762 |
| 763 default: |
| 764 UNREACHABLE(); |
| 765 } |
| 766 } |
| 767 |
| 768 |
744 void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) { | 769 void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) { |
745 switch (expr->op()) { | 770 switch (expr->op()) { |
746 case Token::COMMA: | 771 case Token::COMMA: |
747 ASSERT_EQ(Expression::kEffect, expr->left()->context()); | 772 ASSERT_EQ(Expression::kEffect, expr->left()->context()); |
748 ASSERT_EQ(expr->context(), expr->right()->context()); | 773 ASSERT_EQ(expr->context(), expr->right()->context()); |
749 Visit(expr->left()); | 774 Visit(expr->left()); |
750 Visit(expr->right()); | 775 Visit(expr->right()); |
751 break; | 776 break; |
752 | 777 |
753 case Token::OR: | 778 case Token::OR: |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 } | 893 } |
869 // Save or discard the right-hand value as needed. | 894 // Save or discard the right-hand value as needed. |
870 Visit(right); | 895 Visit(right); |
871 ASSERT_EQ(context, right->context()); | 896 ASSERT_EQ(context, right->context()); |
872 | 897 |
873 __ bind(&done); | 898 __ bind(&done); |
874 } | 899 } |
875 | 900 |
876 | 901 |
877 } } // namespace v8::internal | 902 } } // namespace v8::internal |
OLD | NEW |