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 9059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9070 // rax must be unchanged on jump to not_identical. | 9070 // rax must be unchanged on jump to not_identical. |
9071 | 9071 |
9072 if (never_nan_nan_ && (cc_ == equal)) { | 9072 if (never_nan_nan_ && (cc_ == equal)) { |
9073 __ Set(rax, EQUAL); | 9073 __ Set(rax, EQUAL); |
9074 __ ret(0); | 9074 __ ret(0); |
9075 } else { | 9075 } else { |
9076 Label heap_number; | 9076 Label heap_number; |
9077 // If it's not a heap number, then return equal for (in)equality operator. | 9077 // If it's not a heap number, then return equal for (in)equality operator. |
9078 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), | 9078 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), |
9079 Factory::heap_number_map()); | 9079 Factory::heap_number_map()); |
9080 if (cc_ == equal) { | 9080 __ j(equal, &heap_number); |
9081 __ j(equal, &heap_number); | 9081 if (cc_ != equal) { |
9082 __ Set(rax, EQUAL); | 9082 // Call runtime on identical JSObjects. Otherwise return equal. |
9083 __ ret(0); | 9083 __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rcx); |
9084 } else { | 9084 __ j(above_equal, ¬_identical); |
9085 // Identical objects must still be converted to primitive for < and >. | |
9086 __ j(not_equal, ¬_identical); | |
9087 } | 9085 } |
| 9086 __ Set(rax, EQUAL); |
| 9087 __ ret(0); |
9088 | 9088 |
9089 __ bind(&heap_number); | 9089 __ bind(&heap_number); |
9090 // It is a heap number, so return equal if it's not NaN. | 9090 // It is a heap number, so return equal if it's not NaN. |
9091 // For NaN, return 1 for every condition except greater and | 9091 // For NaN, return 1 for every condition except greater and |
9092 // greater-equal. Return -1 for them, so the comparison yields | 9092 // greater-equal. Return -1 for them, so the comparison yields |
9093 // false for all conditions except not-equal. | 9093 // false for all conditions except not-equal. |
9094 __ Set(rax, EQUAL); | 9094 __ Set(rax, EQUAL); |
9095 __ movsd(xmm0, FieldOperand(rdx, HeapNumber::kValueOffset)); | 9095 __ movsd(xmm0, FieldOperand(rdx, HeapNumber::kValueOffset)); |
9096 __ ucomisd(xmm0, xmm0); | 9096 __ ucomisd(xmm0, xmm0); |
9097 __ setcc(parity_even, rax); | 9097 __ setcc(parity_even, rax); |
(...skipping 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12051 } | 12051 } |
12052 | 12052 |
12053 #endif | 12053 #endif |
12054 | 12054 |
12055 | 12055 |
12056 #undef __ | 12056 #undef __ |
12057 | 12057 |
12058 } } // namespace v8::internal | 12058 } } // namespace v8::internal |
12059 | 12059 |
12060 #endif // V8_TARGET_ARCH_X64 | 12060 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |