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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 if (cc == equal && strict()) { | 1374 if (cc == equal && strict()) { |
1375 Label slow; // Fallthrough label. | 1375 Label slow; // Fallthrough label. |
1376 Label not_smis; | 1376 Label not_smis; |
1377 // If we're doing a strict equality comparison, we don't have to do | 1377 // If we're doing a strict equality comparison, we don't have to do |
1378 // type conversion, so we generate code to do fast comparison for objects | 1378 // type conversion, so we generate code to do fast comparison for objects |
1379 // and oddballs. Non-smi numbers and strings still go through the usual | 1379 // and oddballs. Non-smi numbers and strings still go through the usual |
1380 // slow-case code. | 1380 // slow-case code. |
1381 // If either is a Smi (we know that not both are), then they can only | 1381 // If either is a Smi (we know that not both are), then they can only |
1382 // be equal if the other is a HeapNumber. If so, use the slow case. | 1382 // be equal if the other is a HeapNumber. If so, use the slow case. |
1383 STATIC_ASSERT(kSmiTag == 0); | 1383 STATIC_ASSERT(kSmiTag == 0); |
1384 DCHECK_EQ(0, Smi::FromInt(0)); | 1384 DCHECK_EQ(static_cast<Smi*>(0), Smi::FromInt(0)); |
1385 __ mov(ecx, Immediate(kSmiTagMask)); | 1385 __ mov(ecx, Immediate(kSmiTagMask)); |
1386 __ and_(ecx, eax); | 1386 __ and_(ecx, eax); |
1387 __ test(ecx, edx); | 1387 __ test(ecx, edx); |
1388 __ j(not_zero, ¬_smis, Label::kNear); | 1388 __ j(not_zero, ¬_smis, Label::kNear); |
1389 // One operand is a smi. | 1389 // One operand is a smi. |
1390 | 1390 |
1391 // Check whether the non-smi is a heap number. | 1391 // Check whether the non-smi is a heap number. |
1392 STATIC_ASSERT(kSmiTagMask == 1); | 1392 STATIC_ASSERT(kSmiTagMask == 1); |
1393 // ecx still holds eax & kSmiTag, which is either zero or one. | 1393 // ecx still holds eax & kSmiTag, which is either zero or one. |
1394 __ sub(ecx, Immediate(0x01)); | 1394 __ sub(ecx, Immediate(0x01)); |
(...skipping 3334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4729 ApiParameterOperand(2), kStackSpace, nullptr, | 4729 ApiParameterOperand(2), kStackSpace, nullptr, |
4730 Operand(ebp, 7 * kPointerSize), NULL); | 4730 Operand(ebp, 7 * kPointerSize), NULL); |
4731 } | 4731 } |
4732 | 4732 |
4733 | 4733 |
4734 #undef __ | 4734 #undef __ |
4735 | 4735 |
4736 } } // namespace v8::internal | 4736 } } // namespace v8::internal |
4737 | 4737 |
4738 #endif // V8_TARGET_ARCH_X87 | 4738 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |