OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 if (cc == equal && strict()) { | 1699 if (cc == equal && strict()) { |
1700 Label slow; // Fallthrough label. | 1700 Label slow; // Fallthrough label. |
1701 Label not_smis; | 1701 Label not_smis; |
1702 // If we're doing a strict equality comparison, we don't have to do | 1702 // If we're doing a strict equality comparison, we don't have to do |
1703 // type conversion, so we generate code to do fast comparison for objects | 1703 // type conversion, so we generate code to do fast comparison for objects |
1704 // and oddballs. Non-smi numbers and strings still go through the usual | 1704 // and oddballs. Non-smi numbers and strings still go through the usual |
1705 // slow-case code. | 1705 // slow-case code. |
1706 // If either is a Smi (we know that not both are), then they can only | 1706 // If either is a Smi (we know that not both are), then they can only |
1707 // be equal if the other is a HeapNumber. If so, use the slow case. | 1707 // be equal if the other is a HeapNumber. If so, use the slow case. |
1708 STATIC_ASSERT(kSmiTag == 0); | 1708 STATIC_ASSERT(kSmiTag == 0); |
1709 DCHECK_EQ(0, Smi::FromInt(0)); | 1709 DCHECK_EQ(static_cast<Smi*>(0), Smi::FromInt(0)); |
1710 __ mov(ecx, Immediate(kSmiTagMask)); | 1710 __ mov(ecx, Immediate(kSmiTagMask)); |
1711 __ and_(ecx, eax); | 1711 __ and_(ecx, eax); |
1712 __ test(ecx, edx); | 1712 __ test(ecx, edx); |
1713 __ j(not_zero, ¬_smis, Label::kNear); | 1713 __ j(not_zero, ¬_smis, Label::kNear); |
1714 // One operand is a smi. | 1714 // One operand is a smi. |
1715 | 1715 |
1716 // Check whether the non-smi is a heap number. | 1716 // Check whether the non-smi is a heap number. |
1717 STATIC_ASSERT(kSmiTagMask == 1); | 1717 STATIC_ASSERT(kSmiTagMask == 1); |
1718 // ecx still holds eax & kSmiTag, which is either zero or one. | 1718 // ecx still holds eax & kSmiTag, which is either zero or one. |
1719 __ sub(ecx, Immediate(0x01)); | 1719 __ sub(ecx, Immediate(0x01)); |
(...skipping 3361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5081 ApiParameterOperand(2), kStackSpace, nullptr, | 5081 ApiParameterOperand(2), kStackSpace, nullptr, |
5082 Operand(ebp, 7 * kPointerSize), NULL); | 5082 Operand(ebp, 7 * kPointerSize), NULL); |
5083 } | 5083 } |
5084 | 5084 |
5085 | 5085 |
5086 #undef __ | 5086 #undef __ |
5087 | 5087 |
5088 } } // namespace v8::internal | 5088 } } // namespace v8::internal |
5089 | 5089 |
5090 #endif // V8_TARGET_ARCH_IA32 | 5090 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |