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 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 __ movq(Operand(rsp, kPointerSize), rax); | 1405 __ movq(Operand(rsp, kPointerSize), rax); |
1406 break; | 1406 break; |
1407 case KEYED_PROPERTY: | 1407 case KEYED_PROPERTY: |
1408 __ movq(Operand(rsp, 2 * kPointerSize), rax); | 1408 __ movq(Operand(rsp, 2 * kPointerSize), rax); |
1409 break; | 1409 break; |
1410 } | 1410 } |
1411 break; | 1411 break; |
1412 } | 1412 } |
1413 } | 1413 } |
1414 | 1414 |
1415 // Call runtime for +1/-1. | 1415 // Call stub for +1/-1. |
1416 __ push(rax); | 1416 __ push(rax); |
1417 __ Push(Smi::FromInt(1)); | 1417 __ Push(Smi::FromInt(1)); |
1418 if (expr->op() == Token::INC) { | 1418 GenericBinaryOpStub stub(expr->binary_op(), |
1419 __ CallRuntime(Runtime::kNumberAdd, 2); | 1419 NO_OVERWRITE, |
1420 } else { | 1420 NO_GENERIC_BINARY_FLAGS); |
1421 __ CallRuntime(Runtime::kNumberSub, 2); | 1421 __ CallStub(&stub); |
1422 } | |
1423 | 1422 |
1424 // Store the value returned in rax. | 1423 // Store the value returned in rax. |
1425 switch (assign_type) { | 1424 switch (assign_type) { |
1426 case VARIABLE: | 1425 case VARIABLE: |
1427 __ push(rax); | 1426 __ push(rax); |
1428 if (expr->is_postfix()) { | 1427 if (expr->is_postfix()) { |
1429 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 1428 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
1430 Expression::kEffect); | 1429 Expression::kEffect); |
1431 // For all contexts except kEffect: We have the result on | 1430 // For all contexts except kEffect: We have the result on |
1432 // top of the stack. | 1431 // top of the stack. |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 __ movq(Operand(rsp, 0), rdx); | 1720 __ movq(Operand(rsp, 0), rdx); |
1722 // And return. | 1721 // And return. |
1723 __ ret(0); | 1722 __ ret(0); |
1724 } | 1723 } |
1725 | 1724 |
1726 | 1725 |
1727 #undef __ | 1726 #undef __ |
1728 | 1727 |
1729 | 1728 |
1730 } } // namespace v8::internal | 1729 } } // namespace v8::internal |
OLD | NEW |