OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 StringHelper::GenerateFlatOneByteStringEquals(masm, lhs, rhs, r5, r6); | 700 StringHelper::GenerateFlatOneByteStringEquals(masm, lhs, rhs, r5, r6); |
701 } else { | 701 } else { |
702 StringHelper::GenerateCompareFlatOneByteStrings(masm, lhs, rhs, r5, r6, r7); | 702 StringHelper::GenerateCompareFlatOneByteStrings(masm, lhs, rhs, r5, r6, r7); |
703 } | 703 } |
704 // Never falls through to here. | 704 // Never falls through to here. |
705 | 705 |
706 __ bind(&slow); | 706 __ bind(&slow); |
707 | 707 |
708 __ Push(lhs, rhs); | 708 __ Push(lhs, rhs); |
709 // Figure out which native to call and setup the arguments. | 709 // Figure out which native to call and setup the arguments. |
710 if (cc == eq && strict()) { | 710 if (cc == eq) { |
711 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1); | 711 __ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals, 2, |
| 712 1); |
712 } else { | 713 } else { |
713 int context_index; | 714 int context_index = is_strong(strength()) |
714 if (cc == eq) { | 715 ? Context::COMPARE_STRONG_BUILTIN_INDEX |
715 context_index = Context::EQUALS_BUILTIN_INDEX; | 716 : Context::COMPARE_BUILTIN_INDEX; |
| 717 int ncr; // NaN compare result |
| 718 if (cc == lt || cc == le) { |
| 719 ncr = GREATER; |
716 } else { | 720 } else { |
717 context_index = is_strong(strength()) | 721 DCHECK(cc == gt || cc == ge); // remaining cases |
718 ? Context::COMPARE_STRONG_BUILTIN_INDEX | 722 ncr = LESS; |
719 : Context::COMPARE_BUILTIN_INDEX; | |
720 int ncr; // NaN compare result | |
721 if (cc == lt || cc == le) { | |
722 ncr = GREATER; | |
723 } else { | |
724 DCHECK(cc == gt || cc == ge); // remaining cases | |
725 ncr = LESS; | |
726 } | |
727 __ LoadSmiLiteral(r3, Smi::FromInt(ncr)); | |
728 __ push(r3); | |
729 } | 723 } |
| 724 __ LoadSmiLiteral(r3, Smi::FromInt(ncr)); |
| 725 __ push(r3); |
730 | 726 |
731 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) | 727 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) |
732 // tagged as a small integer. | 728 // tagged as a small integer. |
733 __ InvokeBuiltin(context_index, JUMP_FUNCTION); | 729 __ InvokeBuiltin(context_index, JUMP_FUNCTION); |
734 } | 730 } |
735 | 731 |
736 __ bind(&miss); | 732 __ bind(&miss); |
737 GenerateMiss(masm); | 733 GenerateMiss(masm); |
738 } | 734 } |
739 | 735 |
(...skipping 5116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5856 kStackUnwindSpace, NULL, | 5852 kStackUnwindSpace, NULL, |
5857 MemOperand(fp, 6 * kPointerSize), NULL); | 5853 MemOperand(fp, 6 * kPointerSize), NULL); |
5858 } | 5854 } |
5859 | 5855 |
5860 | 5856 |
5861 #undef __ | 5857 #undef __ |
5862 } // namespace internal | 5858 } // namespace internal |
5863 } // namespace v8 | 5859 } // namespace v8 |
5864 | 5860 |
5865 #endif // V8_TARGET_ARCH_PPC | 5861 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |