| 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 6445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6456 __ j(zero, &compare_lengths, Label::kNear); | 6456 __ j(zero, &compare_lengths, Label::kNear); |
| 6457 | 6457 |
| 6458 // Compare characters. | 6458 // Compare characters. |
| 6459 Label result_not_equal; | 6459 Label result_not_equal; |
| 6460 GenerateAsciiCharsCompareLoop(masm, left, right, min_length, scratch2, | 6460 GenerateAsciiCharsCompareLoop(masm, left, right, min_length, scratch2, |
| 6461 &result_not_equal, Label::kNear); | 6461 &result_not_equal, Label::kNear); |
| 6462 | 6462 |
| 6463 // Compare lengths - strings up to min-length are equal. | 6463 // Compare lengths - strings up to min-length are equal. |
| 6464 __ bind(&compare_lengths); | 6464 __ bind(&compare_lengths); |
| 6465 __ test(length_delta, length_delta); | 6465 __ test(length_delta, length_delta); |
| 6466 #ifndef ENABLE_LATIN_1 |
| 6466 __ j(not_zero, &result_not_equal, Label::kNear); | 6467 __ j(not_zero, &result_not_equal, Label::kNear); |
| 6468 #else |
| 6469 Label length_not_equal; |
| 6470 __ j(not_zero, &length_not_equal, Label::kNear); |
| 6471 #endif |
| 6467 | 6472 |
| 6468 // Result is EQUAL. | 6473 // Result is EQUAL. |
| 6469 STATIC_ASSERT(EQUAL == 0); | 6474 STATIC_ASSERT(EQUAL == 0); |
| 6470 STATIC_ASSERT(kSmiTag == 0); | 6475 STATIC_ASSERT(kSmiTag == 0); |
| 6471 __ Set(eax, Immediate(Smi::FromInt(EQUAL))); | 6476 __ Set(eax, Immediate(Smi::FromInt(EQUAL))); |
| 6472 __ ret(0); | 6477 __ ret(0); |
| 6473 | 6478 |
| 6474 Label result_greater; | 6479 Label result_greater; |
| 6480 #ifdef ENABLE_LATIN_1 |
| 6481 Label result_less; |
| 6482 __ bind(&length_not_equal); |
| 6483 __ j(greater, &result_greater, Label::kNear); |
| 6484 __ jmp(&result_less, Label::kNear); |
| 6485 #endif |
| 6475 __ bind(&result_not_equal); | 6486 __ bind(&result_not_equal); |
| 6487 #ifndef ENABLE_LATIN_1 |
| 6476 __ j(greater, &result_greater, Label::kNear); | 6488 __ j(greater, &result_greater, Label::kNear); |
| 6489 #else |
| 6490 __ j(above, &result_greater, Label::kNear); |
| 6491 __ bind(&result_less); |
| 6492 #endif |
| 6477 | 6493 |
| 6478 // Result is LESS. | 6494 // Result is LESS. |
| 6479 __ Set(eax, Immediate(Smi::FromInt(LESS))); | 6495 __ Set(eax, Immediate(Smi::FromInt(LESS))); |
| 6480 __ ret(0); | 6496 __ ret(0); |
| 6481 | 6497 |
| 6482 // Result is GREATER. | 6498 // Result is GREATER. |
| 6483 __ bind(&result_greater); | 6499 __ bind(&result_greater); |
| 6484 __ Set(eax, Immediate(Smi::FromInt(GREATER))); | 6500 __ Set(eax, Immediate(Smi::FromInt(GREATER))); |
| 6485 __ ret(0); | 6501 __ ret(0); |
| 6486 } | 6502 } |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7505 // Restore ecx. | 7521 // Restore ecx. |
| 7506 __ pop(ecx); | 7522 __ pop(ecx); |
| 7507 __ ret(0); | 7523 __ ret(0); |
| 7508 } | 7524 } |
| 7509 | 7525 |
| 7510 #undef __ | 7526 #undef __ |
| 7511 | 7527 |
| 7512 } } // namespace v8::internal | 7528 } } // namespace v8::internal |
| 7513 | 7529 |
| 7514 #endif // V8_TARGET_ARCH_IA32 | 7530 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |