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 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 __ bind(&check_for_nan); | 1382 __ bind(&check_for_nan); |
1383 } | 1383 } |
1384 } | 1384 } |
1385 | 1385 |
1386 // Test for NaN. Compare heap numbers in a general way, | 1386 // Test for NaN. Compare heap numbers in a general way, |
1387 // to handle NaNs correctly. | 1387 // to handle NaNs correctly. |
1388 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), | 1388 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), |
1389 Immediate(isolate()->factory()->heap_number_map())); | 1389 Immediate(isolate()->factory()->heap_number_map())); |
1390 __ j(equal, &generic_heap_number_comparison, Label::kNear); | 1390 __ j(equal, &generic_heap_number_comparison, Label::kNear); |
1391 if (cc != equal) { | 1391 if (cc != equal) { |
| 1392 Label not_simd; |
1392 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); | 1393 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); |
1393 __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset)); | 1394 __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset)); |
1394 // Call runtime on identical JSObjects. Otherwise return equal. | 1395 // Call runtime on identical JSObjects. Otherwise return equal. |
1395 __ cmpb(ecx, static_cast<uint8_t>(FIRST_SPEC_OBJECT_TYPE)); | 1396 __ cmpb(ecx, static_cast<uint8_t>(FIRST_SPEC_OBJECT_TYPE)); |
1396 __ j(above_equal, &runtime_call, Label::kFar); | 1397 __ j(above_equal, &runtime_call, Label::kFar); |
1397 // Call runtime on identical symbols since we need to throw a TypeError. | 1398 // Call runtime on identical symbols since we need to throw a TypeError. |
1398 __ cmpb(ecx, static_cast<uint8_t>(SYMBOL_TYPE)); | 1399 __ cmpb(ecx, static_cast<uint8_t>(SYMBOL_TYPE)); |
1399 __ j(equal, &runtime_call, Label::kFar); | 1400 __ j(equal, &runtime_call, Label::kFar); |
1400 // Call runtime on identical SIMD values since we must throw a TypeError. | 1401 // Call runtime on identical SIMD values since we must throw a TypeError. |
1401 __ cmpb(ecx, static_cast<uint8_t>(FLOAT32X4_TYPE)); | 1402 __ cmpb(ecx, static_cast<uint8_t>(FIRST_SIMD_VALUE_TYPE)); |
1402 __ j(equal, &runtime_call, Label::kFar); | 1403 __ j(less, ¬_simd, Label::kFar); |
| 1404 __ cmpb(ecx, static_cast<uint8_t>(LAST_SIMD_VALUE_TYPE)); |
| 1405 __ j(less_equal, &runtime_call, Label::kFar); |
| 1406 __ bind(¬_simd); |
1403 if (is_strong(strength())) { | 1407 if (is_strong(strength())) { |
1404 // We have already tested for smis and heap numbers, so if both | 1408 // We have already tested for smis and heap numbers, so if both |
1405 // arguments are not strings we must proceed to the slow case. | 1409 // arguments are not strings we must proceed to the slow case. |
1406 __ test(ecx, Immediate(kIsNotStringMask)); | 1410 __ test(ecx, Immediate(kIsNotStringMask)); |
1407 __ j(not_zero, &runtime_call, Label::kFar); | 1411 __ j(not_zero, &runtime_call, Label::kFar); |
1408 } | 1412 } |
1409 } | 1413 } |
1410 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); | 1414 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); |
1411 __ ret(0); | 1415 __ ret(0); |
1412 | 1416 |
(...skipping 3921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5334 Operand(ebp, 7 * kPointerSize), NULL); | 5338 Operand(ebp, 7 * kPointerSize), NULL); |
5335 } | 5339 } |
5336 | 5340 |
5337 | 5341 |
5338 #undef __ | 5342 #undef __ |
5339 | 5343 |
5340 } // namespace internal | 5344 } // namespace internal |
5341 } // namespace v8 | 5345 } // namespace v8 |
5342 | 5346 |
5343 #endif // V8_TARGET_ARCH_X87 | 5347 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |