| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1406 if (op_ == Token::SUB) { | 1406 if (op_ == Token::SUB) { |
| 1407 if (include_smi_code_) { | 1407 if (include_smi_code_) { |
| 1408 // Check whether the value is a smi. | 1408 // Check whether the value is a smi. |
| 1409 Label try_float; | 1409 Label try_float; |
| 1410 __ JumpIfNotSmi(rax, &try_float); | 1410 __ JumpIfNotSmi(rax, &try_float); |
| 1411 if (negative_zero_ == kIgnoreNegativeZero) { | 1411 if (negative_zero_ == kIgnoreNegativeZero) { |
| 1412 __ SmiCompare(rax, Smi::FromInt(0)); | 1412 __ SmiCompare(rax, Smi::FromInt(0)); |
| 1413 __ j(equal, &done); | 1413 __ j(equal, &done); |
| 1414 } | 1414 } |
| 1415 __ SmiNeg(rax, rax, &done); | 1415 __ SmiNeg(rax, rax, &done); |
| 1416 __ jmp(&slow); // zero, if not handled above, and Smi::kMinValue. |
| 1416 | 1417 |
| 1417 // Either zero or Smi::kMinValue, neither of which become a smi when | |
| 1418 // negated. We handle negative zero here if required. We always enter | |
| 1419 // the runtime system if we have Smi::kMinValue. | |
| 1420 if (negative_zero_ == kStrictNegativeZero) { | |
| 1421 __ SmiCompare(rax, Smi::FromInt(0)); | |
| 1422 __ j(not_equal, &slow); | |
| 1423 __ Move(rax, Factory::minus_zero_value()); | |
| 1424 __ jmp(&done); | |
| 1425 } else { | |
| 1426 __ SmiCompare(rax, Smi::FromInt(Smi::kMinValue)); | |
| 1427 __ j(equal, &slow); | |
| 1428 __ jmp(&done); | |
| 1429 } | |
| 1430 // Try floating point case. | 1418 // Try floating point case. |
| 1431 __ bind(&try_float); | 1419 __ bind(&try_float); |
| 1432 } else if (FLAG_debug_code) { | 1420 } else if (FLAG_debug_code) { |
| 1433 __ AbortIfSmi(rax); | 1421 __ AbortIfSmi(rax); |
| 1434 } | 1422 } |
| 1435 | 1423 |
| 1436 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset)); | 1424 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset)); |
| 1437 __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex); | 1425 __ CompareRoot(rdx, Heap::kHeapNumberMapRootIndex); |
| 1438 __ j(not_equal, &slow); | 1426 __ j(not_equal, &slow); |
| 1439 // Operand is a float, negate its value by flipping sign bit. | 1427 // Operand is a float, negate its value by flipping sign bit. |
| (...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4045 // tagged as a small integer. | 4033 // tagged as a small integer. |
| 4046 __ bind(&runtime); | 4034 __ bind(&runtime); |
| 4047 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 4035 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
| 4048 } | 4036 } |
| 4049 | 4037 |
| 4050 #undef __ | 4038 #undef __ |
| 4051 | 4039 |
| 4052 } } // namespace v8::internal | 4040 } } // namespace v8::internal |
| 4053 | 4041 |
| 4054 #endif // V8_TARGET_ARCH_X64 | 4042 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |