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 5455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5466 | 5466 |
5467 // Compare loop. | 5467 // Compare loop. |
5468 Label result_not_equal; | 5468 Label result_not_equal; |
5469 GenerateAsciiCharsCompareLoop(masm, left, right, min_length, scratch2, | 5469 GenerateAsciiCharsCompareLoop(masm, left, right, min_length, scratch2, |
5470 &result_not_equal, Label::kNear); | 5470 &result_not_equal, Label::kNear); |
5471 | 5471 |
5472 // Completed loop without finding different characters. | 5472 // Completed loop without finding different characters. |
5473 // Compare lengths (precomputed). | 5473 // Compare lengths (precomputed). |
5474 __ bind(&compare_lengths); | 5474 __ bind(&compare_lengths); |
5475 __ SmiTest(length_difference); | 5475 __ SmiTest(length_difference); |
| 5476 #ifndef ENABLE_LATIN_1 |
5476 __ j(not_zero, &result_not_equal, Label::kNear); | 5477 __ j(not_zero, &result_not_equal, Label::kNear); |
| 5478 #else |
| 5479 Label length_not_equal; |
| 5480 __ j(not_zero, &length_not_equal, Label::kNear); |
| 5481 #endif |
5477 | 5482 |
5478 // Result is EQUAL. | 5483 // Result is EQUAL. |
5479 __ Move(rax, Smi::FromInt(EQUAL)); | 5484 __ Move(rax, Smi::FromInt(EQUAL)); |
5480 __ ret(0); | 5485 __ ret(0); |
5481 | 5486 |
5482 Label result_greater; | 5487 Label result_greater; |
| 5488 #ifdef ENABLE_LATIN_1 |
| 5489 Label result_less; |
| 5490 __ bind(&length_not_equal); |
| 5491 __ j(greater, &result_greater, Label::kNear); |
| 5492 __ jmp(&result_less, Label::kNear); |
| 5493 #endif |
5483 __ bind(&result_not_equal); | 5494 __ bind(&result_not_equal); |
5484 // Unequal comparison of left to right, either character or length. | 5495 // Unequal comparison of left to right, either character or length. |
| 5496 #ifndef ENABLE_LATIN_1 |
5485 __ j(greater, &result_greater, Label::kNear); | 5497 __ j(greater, &result_greater, Label::kNear); |
| 5498 #else |
| 5499 __ j(above, &result_greater, Label::kNear); |
| 5500 __ bind(&result_less); |
| 5501 #endif |
5486 | 5502 |
5487 // Result is LESS. | 5503 // Result is LESS. |
5488 __ Move(rax, Smi::FromInt(LESS)); | 5504 __ Move(rax, Smi::FromInt(LESS)); |
5489 __ ret(0); | 5505 __ ret(0); |
5490 | 5506 |
5491 // Result is GREATER. | 5507 // Result is GREATER. |
5492 __ bind(&result_greater); | 5508 __ bind(&result_greater); |
5493 __ Move(rax, Smi::FromInt(GREATER)); | 5509 __ Move(rax, Smi::FromInt(GREATER)); |
5494 __ ret(0); | 5510 __ ret(0); |
5495 } | 5511 } |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6512 #endif | 6528 #endif |
6513 | 6529 |
6514 __ Ret(); | 6530 __ Ret(); |
6515 } | 6531 } |
6516 | 6532 |
6517 #undef __ | 6533 #undef __ |
6518 | 6534 |
6519 } } // namespace v8::internal | 6535 } } // namespace v8::internal |
6520 | 6536 |
6521 #endif // V8_TARGET_ARCH_X64 | 6537 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |