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