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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 } | 685 } |
686 | 686 |
687 | 687 |
688 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { | 688 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { |
689 // ----------- S t a t e ------------- | 689 // ----------- S t a t e ------------- |
690 // -- eax : key (index) | 690 // -- eax : key (index) |
691 // -- edx : receiver | 691 // -- edx : receiver |
692 // -- esp[0] : return address | 692 // -- esp[0] : return address |
693 // ----------------------------------- | 693 // ----------------------------------- |
694 Label miss; | 694 Label miss; |
695 Label index_out_of_range; | |
696 | 695 |
697 Register receiver = edx; | 696 Register receiver = edx; |
698 Register index = eax; | 697 Register index = eax; |
699 Register scratch1 = ebx; | 698 Register scratch1 = ebx; |
700 Register scratch2 = ecx; | 699 Register scratch2 = ecx; |
701 Register result = eax; | 700 Register result = eax; |
702 | 701 |
703 StringCharAtGenerator char_at_generator(receiver, | 702 StringCharAtGenerator char_at_generator(receiver, |
704 index, | 703 index, |
705 scratch1, | 704 scratch1, |
706 scratch2, | 705 scratch2, |
707 result, | 706 result, |
708 &miss, // When not a string. | 707 &miss, // When not a string. |
709 &miss, // When not a number. | 708 &miss, // When not a number. |
710 &index_out_of_range, | 709 &miss, // When index out of range. |
711 STRING_INDEX_IS_ARRAY_INDEX); | 710 STRING_INDEX_IS_ARRAY_INDEX); |
712 char_at_generator.GenerateFast(masm); | 711 char_at_generator.GenerateFast(masm); |
713 __ ret(0); | 712 __ ret(0); |
714 | 713 |
715 ICRuntimeCallHelper call_helper; | 714 ICRuntimeCallHelper call_helper; |
716 char_at_generator.GenerateSlow(masm, call_helper); | 715 char_at_generator.GenerateSlow(masm, call_helper); |
717 | 716 |
718 __ bind(&index_out_of_range); | |
719 __ Set(eax, Immediate(Factory::undefined_value())); | |
720 __ ret(0); | |
721 | |
722 __ bind(&miss); | 717 __ bind(&miss); |
723 GenerateMiss(masm); | 718 GenerateMiss(masm); |
724 } | 719 } |
725 | 720 |
726 | 721 |
727 void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm, | 722 void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm, |
728 ExternalArrayType array_type) { | 723 ExternalArrayType array_type) { |
729 // ----------- S t a t e ------------- | 724 // ----------- S t a t e ------------- |
730 // -- eax : key | 725 // -- eax : key |
731 // -- edx : receiver | 726 // -- edx : receiver |
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1953 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); | 1948 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); |
1954 __ TailCallExternalReference(ref, 3, 1); | 1949 __ TailCallExternalReference(ref, 3, 1); |
1955 } | 1950 } |
1956 | 1951 |
1957 #undef __ | 1952 #undef __ |
1958 | 1953 |
1959 | 1954 |
1960 } } // namespace v8::internal | 1955 } } // namespace v8::internal |
1961 | 1956 |
1962 #endif // V8_TARGET_ARCH_IA32 | 1957 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |