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 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 __ j(is_smi, &done); | 1618 __ j(is_smi, &done); |
1619 __ bind(&stub_call); | 1619 __ bind(&stub_call); |
1620 // Call stub. Undo operation first. | 1620 // Call stub. Undo operation first. |
1621 if (expr->op() == Token::INC) { | 1621 if (expr->op() == Token::INC) { |
1622 __ SmiSubConstant(rax, rax, Smi::FromInt(1)); | 1622 __ SmiSubConstant(rax, rax, Smi::FromInt(1)); |
1623 } else { | 1623 } else { |
1624 __ SmiAddConstant(rax, rax, Smi::FromInt(1)); | 1624 __ SmiAddConstant(rax, rax, Smi::FromInt(1)); |
1625 } | 1625 } |
1626 } | 1626 } |
1627 // Call stub for +1/-1. | 1627 // Call stub for +1/-1. |
1628 __ push(rax); | |
1629 __ Push(Smi::FromInt(1)); | |
1630 GenericBinaryOpStub stub(expr->binary_op(), | 1628 GenericBinaryOpStub stub(expr->binary_op(), |
1631 NO_OVERWRITE, | 1629 NO_OVERWRITE, |
1632 NO_GENERIC_BINARY_FLAGS); | 1630 NO_GENERIC_BINARY_FLAGS); |
1633 __ CallStub(&stub); | 1631 stub.GenerateCall(masm_, rax, Smi::FromInt(1)); |
1634 __ bind(&done); | 1632 __ bind(&done); |
1635 | 1633 |
1636 // Store the value returned in rax. | 1634 // Store the value returned in rax. |
1637 switch (assign_type) { | 1635 switch (assign_type) { |
1638 case VARIABLE: | 1636 case VARIABLE: |
1639 if (expr->is_postfix()) { | 1637 if (expr->is_postfix()) { |
1640 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 1638 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
1641 Expression::kEffect); | 1639 Expression::kEffect); |
1642 // For all contexts except kEffect: We have the result on | 1640 // For all contexts except kEffect: We have the result on |
1643 // top of the stack. | 1641 // top of the stack. |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 __ movq(Operand(rsp, 0), rdx); | 1884 __ movq(Operand(rsp, 0), rdx); |
1887 // And return. | 1885 // And return. |
1888 __ ret(0); | 1886 __ ret(0); |
1889 } | 1887 } |
1890 | 1888 |
1891 | 1889 |
1892 #undef __ | 1890 #undef __ |
1893 | 1891 |
1894 | 1892 |
1895 } } // namespace v8::internal | 1893 } } // namespace v8::internal |
OLD | NEW |