| 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 6558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6569 Label not_smis; | 6569 Label not_smis; |
| 6570 ASSERT_EQ(0, kSmiTag); | 6570 ASSERT_EQ(0, kSmiTag); |
| 6571 ASSERT_EQ(0, Smi::FromInt(0)); | 6571 ASSERT_EQ(0, Smi::FromInt(0)); |
| 6572 __ movq(rcx, Immediate(kSmiTagMask)); | 6572 __ movq(rcx, Immediate(kSmiTagMask)); |
| 6573 __ and_(rcx, rax); | 6573 __ and_(rcx, rax); |
| 6574 __ testq(rcx, rdx); | 6574 __ testq(rcx, rdx); |
| 6575 __ j(not_zero, ¬_smis); | 6575 __ j(not_zero, ¬_smis); |
| 6576 // One operand is a smi. | 6576 // One operand is a smi. |
| 6577 | 6577 |
| 6578 // Check whether the non-smi is a heap number. | 6578 // Check whether the non-smi is a heap number. |
| 6579 ASSERT_EQ(static_cast<intptr_t>(1), kSmiTagMask); | 6579 ASSERT_EQ(1, static_cast<int>(kSmiTagMask)); |
| 6580 // rcx still holds rax & kSmiTag, which is either zero or one. | 6580 // rcx still holds rax & kSmiTag, which is either zero or one. |
| 6581 __ decq(rcx); // If rax is a smi, all 1s, else all 0s. | 6581 __ decq(rcx); // If rax is a smi, all 1s, else all 0s. |
| 6582 __ movq(rbx, rdx); | 6582 __ movq(rbx, rdx); |
| 6583 __ xor_(rbx, rax); | 6583 __ xor_(rbx, rax); |
| 6584 __ and_(rbx, rcx); // rbx holds either 0 or rax ^ rdx. | 6584 __ and_(rbx, rcx); // rbx holds either 0 or rax ^ rdx. |
| 6585 __ xor_(rbx, rax); | 6585 __ xor_(rbx, rax); |
| 6586 // if rax was smi, rbx is now rdx, else rax. | 6586 // if rax was smi, rbx is now rdx, else rax. |
| 6587 | 6587 |
| 6588 // Check if the non-smi operand is a heap number. | 6588 // Check if the non-smi operand is a heap number. |
| 6589 __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset), | 6589 __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset), |
| (...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7904 int CompareStub::MinorKey() { | 7904 int CompareStub::MinorKey() { |
| 7905 // Encode the two parameters in a unique 16 bit value. | 7905 // Encode the two parameters in a unique 16 bit value. |
| 7906 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); | 7906 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); |
| 7907 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); | 7907 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); |
| 7908 } | 7908 } |
| 7909 | 7909 |
| 7910 | 7910 |
| 7911 #undef __ | 7911 #undef __ |
| 7912 | 7912 |
| 7913 } } // namespace v8::internal | 7913 } } // namespace v8::internal |
| OLD | NEW |