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 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 | 1378 |
1379 // Test for NaN. Compare heap numbers in a general way, | 1379 // Test for NaN. Compare heap numbers in a general way, |
1380 // to hanlde NaNs correctly. | 1380 // to hanlde NaNs correctly. |
1381 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), | 1381 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), |
1382 Immediate(isolate()->factory()->heap_number_map())); | 1382 Immediate(isolate()->factory()->heap_number_map())); |
1383 __ j(equal, &generic_heap_number_comparison, Label::kNear); | 1383 __ j(equal, &generic_heap_number_comparison, Label::kNear); |
1384 if (cc != equal) { | 1384 if (cc != equal) { |
1385 // Call runtime on identical JSObjects. Otherwise return equal. | 1385 // Call runtime on identical JSObjects. Otherwise return equal. |
1386 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); | 1386 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); |
1387 __ j(above_equal, ¬_identical); | 1387 __ j(above_equal, ¬_identical); |
| 1388 // Call runtime on identical symbols since we need to throw a TypeError. |
| 1389 __ CmpObjectType(eax, SYMBOL_TYPE, ecx); |
| 1390 __ j(equal, ¬_identical); |
1388 } | 1391 } |
1389 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); | 1392 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); |
1390 __ ret(0); | 1393 __ ret(0); |
1391 | 1394 |
1392 | 1395 |
1393 __ bind(¬_identical); | 1396 __ bind(¬_identical); |
1394 } | 1397 } |
1395 | 1398 |
1396 // Strict equality can quickly decide whether objects are equal. | 1399 // Strict equality can quickly decide whether objects are equal. |
1397 // Non-strict object equality is slower, so it is handled later in the stub. | 1400 // Non-strict object equality is slower, so it is handled later in the stub. |
(...skipping 3669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5067 ApiParameterOperand(2), kStackSpace, nullptr, | 5070 ApiParameterOperand(2), kStackSpace, nullptr, |
5068 Operand(ebp, 7 * kPointerSize), NULL); | 5071 Operand(ebp, 7 * kPointerSize), NULL); |
5069 } | 5072 } |
5070 | 5073 |
5071 | 5074 |
5072 #undef __ | 5075 #undef __ |
5073 | 5076 |
5074 } } // namespace v8::internal | 5077 } } // namespace v8::internal |
5075 | 5078 |
5076 #endif // V8_TARGET_ARCH_X87 | 5079 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |