OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 } | 748 } |
749 | 749 |
750 | 750 |
751 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { | 751 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { |
752 // ----------- S t a t e ------------- | 752 // ----------- S t a t e ------------- |
753 // -- rax : key | 753 // -- rax : key |
754 // -- rdx : receiver | 754 // -- rdx : receiver |
755 // -- rsp[0] : return address | 755 // -- rsp[0] : return address |
756 // ----------------------------------- | 756 // ----------------------------------- |
757 Label miss; | 757 Label miss; |
758 Label index_out_of_range; | |
759 | 758 |
760 Register receiver = rdx; | 759 Register receiver = rdx; |
761 Register index = rax; | 760 Register index = rax; |
762 Register scratch1 = rbx; | 761 Register scratch1 = rbx; |
763 Register scratch2 = rcx; | 762 Register scratch2 = rcx; |
764 Register result = rax; | 763 Register result = rax; |
765 | 764 |
766 StringCharAtGenerator char_at_generator(receiver, | 765 StringCharAtGenerator char_at_generator(receiver, |
767 index, | 766 index, |
768 scratch1, | 767 scratch1, |
769 scratch2, | 768 scratch2, |
770 result, | 769 result, |
771 &miss, // When not a string. | 770 &miss, // When not a string. |
772 &miss, // When not a number. | 771 &miss, // When not a number. |
773 &index_out_of_range, | 772 &miss, // When index out of range. |
774 STRING_INDEX_IS_ARRAY_INDEX); | 773 STRING_INDEX_IS_ARRAY_INDEX); |
775 char_at_generator.GenerateFast(masm); | 774 char_at_generator.GenerateFast(masm); |
776 __ ret(0); | 775 __ ret(0); |
777 | 776 |
778 ICRuntimeCallHelper call_helper; | 777 ICRuntimeCallHelper call_helper; |
779 char_at_generator.GenerateSlow(masm, call_helper); | 778 char_at_generator.GenerateSlow(masm, call_helper); |
780 | 779 |
781 __ bind(&index_out_of_range); | |
782 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | |
783 __ ret(0); | |
784 | |
785 __ bind(&miss); | 780 __ bind(&miss); |
786 GenerateMiss(masm); | 781 GenerateMiss(masm); |
787 } | 782 } |
788 | 783 |
789 | 784 |
790 void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm, | 785 void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm, |
791 ExternalArrayType array_type) { | 786 ExternalArrayType array_type) { |
792 // ----------- S t a t e ------------- | 787 // ----------- S t a t e ------------- |
793 // -- rax : key | 788 // -- rax : key |
794 // -- rdx : receiver | 789 // -- rdx : receiver |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1918 GenerateMiss(masm); | 1913 GenerateMiss(masm); |
1919 } | 1914 } |
1920 | 1915 |
1921 | 1916 |
1922 #undef __ | 1917 #undef __ |
1923 | 1918 |
1924 | 1919 |
1925 } } // namespace v8::internal | 1920 } } // namespace v8::internal |
1926 | 1921 |
1927 #endif // V8_TARGET_ARCH_X64 | 1922 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |