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 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 | 1703 |
1704 // Test for NaN. Compare heap numbers in a general way, | 1704 // Test for NaN. Compare heap numbers in a general way, |
1705 // to hanlde NaNs correctly. | 1705 // to hanlde NaNs correctly. |
1706 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), | 1706 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), |
1707 Immediate(isolate()->factory()->heap_number_map())); | 1707 Immediate(isolate()->factory()->heap_number_map())); |
1708 __ j(equal, &generic_heap_number_comparison, Label::kNear); | 1708 __ j(equal, &generic_heap_number_comparison, Label::kNear); |
1709 if (cc != equal) { | 1709 if (cc != equal) { |
1710 // Call runtime on identical JSObjects. Otherwise return equal. | 1710 // Call runtime on identical JSObjects. Otherwise return equal. |
1711 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); | 1711 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); |
1712 __ j(above_equal, ¬_identical); | 1712 __ j(above_equal, ¬_identical); |
| 1713 // Call runtime on identical symbols since we need to throw a TypeError. |
| 1714 __ CmpObjectType(eax, SYMBOL_TYPE, ecx); |
| 1715 __ j(equal, ¬_identical); |
1713 } | 1716 } |
1714 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); | 1717 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); |
1715 __ ret(0); | 1718 __ ret(0); |
1716 | 1719 |
1717 | 1720 |
1718 __ bind(¬_identical); | 1721 __ bind(¬_identical); |
1719 } | 1722 } |
1720 | 1723 |
1721 // Strict equality can quickly decide whether objects are equal. | 1724 // Strict equality can quickly decide whether objects are equal. |
1722 // Non-strict object equality is slower, so it is handled later in the stub. | 1725 // Non-strict object equality is slower, so it is handled later in the stub. |
(...skipping 3684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5407 ApiParameterOperand(2), kStackSpace, nullptr, | 5410 ApiParameterOperand(2), kStackSpace, nullptr, |
5408 Operand(ebp, 7 * kPointerSize), NULL); | 5411 Operand(ebp, 7 * kPointerSize), NULL); |
5409 } | 5412 } |
5410 | 5413 |
5411 | 5414 |
5412 #undef __ | 5415 #undef __ |
5413 | 5416 |
5414 } } // namespace v8::internal | 5417 } } // namespace v8::internal |
5415 | 5418 |
5416 #endif // V8_TARGET_ARCH_IA32 | 5419 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |