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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 __ movzx_w(result, Operand(result, index, times_2, 0)); | 725 __ movzx_w(result, Operand(result, index, times_2, 0)); |
726 __ jmp(&done, Label::kNear); | 726 __ jmp(&done, Label::kNear); |
727 __ bind(&ascii_external); | 727 __ bind(&ascii_external); |
728 // Ascii string. | 728 // Ascii string. |
729 __ movzx_b(result, Operand(result, index, times_1, 0)); | 729 __ movzx_b(result, Operand(result, index, times_1, 0)); |
730 __ jmp(&done, Label::kNear); | 730 __ jmp(&done, Label::kNear); |
731 | 731 |
732 // Dispatch on the encoding: ASCII or two-byte. | 732 // Dispatch on the encoding: ASCII or two-byte. |
733 Label ascii; | 733 Label ascii; |
734 __ bind(&seq_string); | 734 __ bind(&seq_string); |
735 STATIC_ASSERT((kStringEncodingMask & kAsciiStringTag) != 0); | 735 STATIC_ASSERT((kStringEncodingMask & kOneByteStringTag) != 0); |
736 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); | 736 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); |
737 __ test(result, Immediate(kStringEncodingMask)); | 737 __ test(result, Immediate(kStringEncodingMask)); |
738 __ j(not_zero, &ascii, Label::kNear); | 738 __ j(not_zero, &ascii, Label::kNear); |
739 | 739 |
740 // Two-byte string. | 740 // Two-byte string. |
741 // Load the two-byte character code into the result register. | 741 // Load the two-byte character code into the result register. |
742 __ movzx_w(result, FieldOperand(string, | 742 __ movzx_w(result, FieldOperand(string, |
743 index, | 743 index, |
744 times_2, | 744 times_2, |
745 SeqTwoByteString::kHeaderSize)); | 745 SeqTwoByteString::kHeaderSize)); |
746 __ jmp(&done, Label::kNear); | 746 __ jmp(&done, Label::kNear); |
747 | 747 |
748 // Ascii string. | 748 // Ascii string. |
749 // Load the byte into the result register. | 749 // Load the byte into the result register. |
750 __ bind(&ascii); | 750 __ bind(&ascii); |
751 __ movzx_b(result, FieldOperand(string, | 751 __ movzx_b(result, FieldOperand(string, |
752 index, | 752 index, |
753 times_1, | 753 times_1, |
754 SeqAsciiString::kHeaderSize)); | 754 SeqAsciiString::kHeaderSize)); |
755 __ bind(&done); | 755 __ bind(&done); |
756 } | 756 } |
757 | 757 |
758 #undef __ | 758 #undef __ |
759 | 759 |
760 } } // namespace v8::internal | 760 } } // namespace v8::internal |
761 | 761 |
762 #endif // V8_TARGET_ARCH_IA32 | 762 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |