552 Label noLoop, haveResult; |
552 Label noLoop, haveResult; |
553 __ testptr (rax, rax); |
553 __ testptr (rax, rax); |
554 __ jcc (Assembler::zero, noLoop); |
554 __ jcc (Assembler::zero, noLoop); |
555 |
555 |
556 // compare first characters |
556 // compare first characters |
557 __ load_unsigned_word(rcx, Address(rdi, 0)); |
557 __ load_unsigned_short(rcx, Address(rdi, 0)); |
558 __ load_unsigned_word(rbx, Address(rsi, 0)); |
558 __ load_unsigned_short(rbx, Address(rsi, 0)); |
559 __ subl(rcx, rbx); |
559 __ subl(rcx, rbx); |
560 __ jcc(Assembler::notZero, haveResult); |
560 __ jcc(Assembler::notZero, haveResult); |
561 // starting loop |
561 // starting loop |
562 __ decrement(rax); // we already tested index: skip one |
562 __ decrement(rax); // we already tested index: skip one |
563 __ jcc(Assembler::zero, noLoop); |
563 __ jcc(Assembler::zero, noLoop); |
572 // compare the strings in a loop |
572 // compare the strings in a loop |
573 |
573 |
574 Label loop; |
574 Label loop; |
575 __ align(wordSize); |
575 __ align(wordSize); |
576 __ bind(loop); |
576 __ bind(loop); |
577 __ load_unsigned_word(rcx, Address(rdi, rax, Address::times_2, 0)); |
577 __ load_unsigned_short(rcx, Address(rdi, rax, Address::times_2, 0)); |
578 __ load_unsigned_word(rbx, Address(rsi, rax, Address::times_2, 0)); |
578 __ load_unsigned_short(rbx, Address(rsi, rax, Address::times_2, 0)); |
579 __ subl(rcx, rbx); |
579 __ subl(rcx, rbx); |
580 __ jcc(Assembler::notZero, haveResult); |
580 __ jcc(Assembler::notZero, haveResult); |
581 __ increment(rax); |
581 __ increment(rax); |
582 __ jcc(Assembler::notZero, loop); |
582 __ jcc(Assembler::notZero, loop); |
583 |
583 |