| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 VisitInDuplicateContext(right); | 1046 VisitInDuplicateContext(right); |
| 1047 __ bind(&done); | 1047 __ bind(&done); |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 | 1050 |
| 1051 void FullCodeGenerator::VisitArithmeticExpression(BinaryOperation* expr) { | 1051 void FullCodeGenerator::VisitArithmeticExpression(BinaryOperation* expr) { |
| 1052 Token::Value op = expr->op(); | 1052 Token::Value op = expr->op(); |
| 1053 Comment cmnt(masm_, "[ ArithmeticExpression"); | 1053 Comment cmnt(masm_, "[ ArithmeticExpression"); |
| 1054 Expression* left = expr->left(); | 1054 Expression* left = expr->left(); |
| 1055 Expression* right = expr->right(); | 1055 Expression* right = expr->right(); |
| 1056 OverwriteMode mode = | |
| 1057 left->ResultOverwriteAllowed() | |
| 1058 ? OVERWRITE_LEFT | |
| 1059 : (right->ResultOverwriteAllowed() ? OVERWRITE_RIGHT : NO_OVERWRITE); | |
| 1060 | 1056 |
| 1061 VisitForStackValue(left); | 1057 VisitForStackValue(left); |
| 1062 VisitForAccumulatorValue(right); | 1058 VisitForAccumulatorValue(right); |
| 1063 | 1059 |
| 1064 SetSourcePosition(expr->position()); | 1060 SetSourcePosition(expr->position()); |
| 1065 if (ShouldInlineSmiCase(op)) { | 1061 if (ShouldInlineSmiCase(op)) { |
| 1066 EmitInlineSmiBinaryOp(expr, op, mode, left, right); | 1062 EmitInlineSmiBinaryOp(expr, op, left, right); |
| 1067 } else { | 1063 } else { |
| 1068 EmitBinaryOp(expr, op, mode); | 1064 EmitBinaryOp(expr, op); |
| 1069 } | 1065 } |
| 1070 } | 1066 } |
| 1071 | 1067 |
| 1072 | 1068 |
| 1073 void FullCodeGenerator::VisitBlock(Block* stmt) { | 1069 void FullCodeGenerator::VisitBlock(Block* stmt) { |
| 1074 Comment cmnt(masm_, "[ Block"); | 1070 Comment cmnt(masm_, "[ Block"); |
| 1075 NestedBlock nested_block(this, stmt); | 1071 NestedBlock nested_block(this, stmt); |
| 1076 SetStatementPosition(stmt); | 1072 SetStatementPosition(stmt); |
| 1077 | 1073 |
| 1078 Scope* saved_scope = scope(); | 1074 Scope* saved_scope = scope(); |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 } | 1608 } |
| 1613 | 1609 |
| 1614 return false; | 1610 return false; |
| 1615 } | 1611 } |
| 1616 | 1612 |
| 1617 | 1613 |
| 1618 #undef __ | 1614 #undef __ |
| 1619 | 1615 |
| 1620 | 1616 |
| 1621 } } // namespace v8::internal | 1617 } } // namespace v8::internal |
| OLD | NEW |