OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 5738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5749 | 5749 |
5750 // Compare loop. | 5750 // Compare loop. |
5751 Label result_not_equal; | 5751 Label result_not_equal; |
5752 GenerateAsciiCharsCompareLoop(masm, left, right, min_length, scratch2, | 5752 GenerateAsciiCharsCompareLoop(masm, left, right, min_length, scratch2, |
5753 &result_not_equal, Label::kNear); | 5753 &result_not_equal, Label::kNear); |
5754 | 5754 |
5755 // Completed loop without finding different characters. | 5755 // Completed loop without finding different characters. |
5756 // Compare lengths (precomputed). | 5756 // Compare lengths (precomputed). |
5757 __ bind(&compare_lengths); | 5757 __ bind(&compare_lengths); |
5758 __ SmiTest(length_difference); | 5758 __ SmiTest(length_difference); |
5759 #ifndef ENABLE_LATIN_1 | |
5760 __ j(not_zero, &result_not_equal, Label::kNear); | |
5761 #else | |
5762 Label length_not_equal; | 5759 Label length_not_equal; |
5763 __ j(not_zero, &length_not_equal, Label::kNear); | 5760 __ j(not_zero, &length_not_equal, Label::kNear); |
5764 #endif | |
5765 | 5761 |
5766 // Result is EQUAL. | 5762 // Result is EQUAL. |
5767 __ Move(rax, Smi::FromInt(EQUAL)); | 5763 __ Move(rax, Smi::FromInt(EQUAL)); |
5768 __ ret(0); | 5764 __ ret(0); |
5769 | 5765 |
5770 Label result_greater; | 5766 Label result_greater; |
5771 #ifdef ENABLE_LATIN_1 | |
5772 Label result_less; | 5767 Label result_less; |
5773 __ bind(&length_not_equal); | 5768 __ bind(&length_not_equal); |
5774 __ j(greater, &result_greater, Label::kNear); | 5769 __ j(greater, &result_greater, Label::kNear); |
5775 __ jmp(&result_less, Label::kNear); | 5770 __ jmp(&result_less, Label::kNear); |
5776 #endif | |
5777 __ bind(&result_not_equal); | 5771 __ bind(&result_not_equal); |
5778 // Unequal comparison of left to right, either character or length. | 5772 // Unequal comparison of left to right, either character or length. |
5779 #ifndef ENABLE_LATIN_1 | |
5780 __ j(greater, &result_greater, Label::kNear); | |
5781 #else | |
5782 __ j(above, &result_greater, Label::kNear); | 5773 __ j(above, &result_greater, Label::kNear); |
5783 __ bind(&result_less); | 5774 __ bind(&result_less); |
5784 #endif | |
5785 | 5775 |
5786 // Result is LESS. | 5776 // Result is LESS. |
5787 __ Move(rax, Smi::FromInt(LESS)); | 5777 __ Move(rax, Smi::FromInt(LESS)); |
5788 __ ret(0); | 5778 __ ret(0); |
5789 | 5779 |
5790 // Result is GREATER. | 5780 // Result is GREATER. |
5791 __ bind(&result_greater); | 5781 __ bind(&result_greater); |
5792 __ Move(rax, Smi::FromInt(GREATER)); | 5782 __ Move(rax, Smi::FromInt(GREATER)); |
5793 __ ret(0); | 5783 __ ret(0); |
5794 } | 5784 } |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6885 #endif | 6875 #endif |
6886 | 6876 |
6887 __ Ret(); | 6877 __ Ret(); |
6888 } | 6878 } |
6889 | 6879 |
6890 #undef __ | 6880 #undef __ |
6891 | 6881 |
6892 } } // namespace v8::internal | 6882 } } // namespace v8::internal |
6893 | 6883 |
6894 #endif // V8_TARGET_ARCH_X64 | 6884 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |