OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 9635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9646 // Find minimum length. If either length is zero just compare lengths. | 9646 // Find minimum length. If either length is zero just compare lengths. |
9647 __ mov(counter, FieldOperand(left, String::kLengthOffset)); | 9647 __ mov(counter, FieldOperand(left, String::kLengthOffset)); |
9648 __ test(counter, Operand(counter)); | 9648 __ test(counter, Operand(counter)); |
9649 __ j(zero, &compare_lengths_1); | 9649 __ j(zero, &compare_lengths_1); |
9650 __ mov(scratch1, FieldOperand(right, String::kLengthOffset)); | 9650 __ mov(scratch1, FieldOperand(right, String::kLengthOffset)); |
9651 __ test(scratch1, Operand(scratch1)); | 9651 __ test(scratch1, Operand(scratch1)); |
9652 __ j(zero, &compare_lengths_1); | 9652 __ j(zero, &compare_lengths_1); |
9653 __ cmp(counter, Operand(scratch1)); | 9653 __ cmp(counter, Operand(scratch1)); |
9654 if (CpuFeatures::IsSupported(CMOV)) { | 9654 if (CpuFeatures::IsSupported(CMOV)) { |
9655 CpuFeatures::Scope use_cmov(CMOV); | 9655 CpuFeatures::Scope use_cmov(CMOV); |
9656 __ cmov(less, counter, Operand(scratch1)); | 9656 __ cmov(greater, counter, Operand(scratch1)); |
9657 } else { | 9657 } else { |
9658 Label l; | 9658 Label l; |
9659 __ j(less, &l); | 9659 __ j(less, &l); |
9660 __ mov(counter, scratch1); | 9660 __ mov(counter, scratch1); |
9661 __ bind(&l); | 9661 __ bind(&l); |
9662 } | 9662 } |
9663 | 9663 |
9664 Label result_greater, result_less; | 9664 Label result_greater, result_less; |
9665 Label loop; | 9665 Label loop; |
9666 // Compare next character. | 9666 // Compare next character. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9767 | 9767 |
9768 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 9768 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
9769 // tagged as a small integer. | 9769 // tagged as a small integer. |
9770 __ bind(&runtime); | 9770 __ bind(&runtime); |
9771 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); | 9771 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); |
9772 } | 9772 } |
9773 | 9773 |
9774 #undef __ | 9774 #undef __ |
9775 | 9775 |
9776 } } // namespace v8::internal | 9776 } } // namespace v8::internal |
OLD | NEW |