| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 6513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6524 __ mov(eax, 0); | 6524 __ mov(eax, 0); |
| 6525 __ ret(1 * kPointerSize); | 6525 __ ret(1 * kPointerSize); |
| 6526 } | 6526 } |
| 6527 | 6527 |
| 6528 | 6528 |
| 6529 void GenericBinaryOpStub::GenerateCall( | 6529 void GenericBinaryOpStub::GenerateCall( |
| 6530 MacroAssembler* masm, | 6530 MacroAssembler* masm, |
| 6531 Register left, | 6531 Register left, |
| 6532 Register right) { | 6532 Register right) { |
| 6533 if (!ArgsInRegistersSupported()) { | 6533 if (!ArgsInRegistersSupported()) { |
| 6534 // Only pass arguments in registers if there is no smi code in the stub. | 6534 // Pass arguments on the stack. |
| 6535 __ push(left); | 6535 __ push(left); |
| 6536 __ push(right); | 6536 __ push(right); |
| 6537 } else { | 6537 } else { |
| 6538 // The calling convention with registers is left in edx and right in eax. | 6538 // The calling convention with registers is left in edx and right in eax. |
| 6539 __ IncrementCounter(&Counters::generic_binary_stub_calls_regs, 1); | 6539 __ IncrementCounter(&Counters::generic_binary_stub_calls_regs, 1); |
| 6540 if (!(left.is(edx) && right.is(eax))) { | 6540 if (!(left.is(edx) && right.is(eax))) { |
| 6541 if (left.is(eax) && right.is(edx)) { | 6541 if (left.is(eax) && right.is(edx)) { |
| 6542 if (IsOperationCommutative()) { | 6542 if (IsOperationCommutative()) { |
| 6543 SetArgsReversed(); | 6543 SetArgsReversed(); |
| 6544 } else { | 6544 } else { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6577 // Call the stub. | 6577 // Call the stub. |
| 6578 __ CallStub(this); | 6578 __ CallStub(this); |
| 6579 } | 6579 } |
| 6580 | 6580 |
| 6581 | 6581 |
| 6582 void GenericBinaryOpStub::GenerateCall( | 6582 void GenericBinaryOpStub::GenerateCall( |
| 6583 MacroAssembler* masm, | 6583 MacroAssembler* masm, |
| 6584 Register left, | 6584 Register left, |
| 6585 Smi* right) { | 6585 Smi* right) { |
| 6586 if (!ArgsInRegistersSupported()) { | 6586 if (!ArgsInRegistersSupported()) { |
| 6587 // Only pass arguments in registers if there is no smi code in the stub. | 6587 // Pass arguments on the stack. |
| 6588 __ push(left); | 6588 __ push(left); |
| 6589 __ push(Immediate(right)); | 6589 __ push(Immediate(right)); |
| 6590 } else { | 6590 } else { |
| 6591 // Adapt arguments to the calling convention left in edx and right in eax. | 6591 // Adapt arguments to the calling convention left in edx and right in eax. |
| 6592 if (left.is(edx)) { | 6592 if (left.is(edx)) { |
| 6593 __ mov(eax, Immediate(right)); | 6593 __ mov(eax, Immediate(right)); |
| 6594 } else if (left.is(eax) && IsOperationCommutative()) { | 6594 } else if (left.is(eax) && IsOperationCommutative()) { |
| 6595 __ mov(edx, Immediate(right)); | 6595 __ mov(edx, Immediate(right)); |
| 6596 SetArgsReversed(); | 6596 SetArgsReversed(); |
| 6597 } else { | 6597 } else { |
| 6598 __ mov(edx, left); | 6598 __ mov(edx, left); |
| 6599 __ mov(eax, Immediate(right)); | 6599 __ mov(eax, Immediate(right)); |
| 6600 } | 6600 } |
| 6601 | 6601 |
| 6602 // Update flags to indicate that arguments are in registers. | 6602 // Update flags to indicate that arguments are in registers. |
| 6603 SetArgsInRegisters(); | 6603 SetArgsInRegisters(); |
| 6604 } | 6604 } |
| 6605 | 6605 |
| 6606 // Call the stub. | 6606 // Call the stub. |
| 6607 __ CallStub(this); | 6607 __ CallStub(this); |
| 6608 } | 6608 } |
| 6609 | 6609 |
| 6610 | 6610 |
| 6611 void GenericBinaryOpStub::GenerateCall( | 6611 void GenericBinaryOpStub::GenerateCall( |
| 6612 MacroAssembler* masm, | 6612 MacroAssembler* masm, |
| 6613 Smi* left, | 6613 Smi* left, |
| 6614 Register right) { | 6614 Register right) { |
| 6615 if (flags_ != NO_SMI_CODE_IN_STUB) { | 6615 if (!ArgsInRegistersSupported()) { |
| 6616 // Only pass arguments in registers if there is no smi code in the stub. | 6616 // Pass arguments on the stack. |
| 6617 __ push(Immediate(left)); | 6617 __ push(Immediate(left)); |
| 6618 __ push(right); | 6618 __ push(right); |
| 6619 } else { | 6619 } else { |
| 6620 // Adapt arguments to the calling convention left in edx and right in eax. | 6620 // Adapt arguments to the calling convention left in edx and right in eax. |
| 6621 bool is_commutative = (op_ == (Token::ADD) || (op_ == Token::MUL)); | 6621 bool is_commutative = (op_ == (Token::ADD) || (op_ == Token::MUL)); |
| 6622 if (right.is(eax)) { | 6622 if (right.is(eax)) { |
| 6623 __ mov(edx, Immediate(left)); | 6623 __ mov(edx, Immediate(left)); |
| 6624 } else if (right.is(edx) && is_commutative) { | 6624 } else if (right.is(edx) && is_commutative) { |
| 6625 __ mov(eax, Immediate(left)); | 6625 __ mov(eax, Immediate(left)); |
| 6626 } else { | 6626 } else { |
| (...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8126 | 8126 |
| 8127 int CompareStub::MinorKey() { | 8127 int CompareStub::MinorKey() { |
| 8128 // Encode the two parameters in a unique 16 bit value. | 8128 // Encode the two parameters in a unique 16 bit value. |
| 8129 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); | 8129 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); |
| 8130 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); | 8130 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); |
| 8131 } | 8131 } |
| 8132 | 8132 |
| 8133 #undef __ | 8133 #undef __ |
| 8134 | 8134 |
| 8135 } } // namespace v8::internal | 8135 } } // namespace v8::internal |
| OLD | NEW |