| 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 } | 691 } |
| 692 | 692 |
| 693 | 693 |
| 694 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { | 694 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { |
| 695 // ----------- S t a t e ------------- | 695 // ----------- S t a t e ------------- |
| 696 // -- eax : key (index) | 696 // -- eax : key (index) |
| 697 // -- edx : receiver | 697 // -- edx : receiver |
| 698 // -- esp[0] : return address | 698 // -- esp[0] : return address |
| 699 // ----------------------------------- | 699 // ----------------------------------- |
| 700 Label miss; | 700 Label miss; |
| 701 Label index_out_of_range; | |
| 702 | 701 |
| 703 Register receiver = edx; | 702 Register receiver = edx; |
| 704 Register index = eax; | 703 Register index = eax; |
| 705 Register scratch1 = ebx; | 704 Register scratch1 = ebx; |
| 706 Register scratch2 = ecx; | 705 Register scratch2 = ecx; |
| 707 Register result = eax; | 706 Register result = eax; |
| 708 | 707 |
| 709 StringCharAtGenerator char_at_generator(receiver, | 708 StringCharAtGenerator char_at_generator(receiver, |
| 710 index, | 709 index, |
| 711 scratch1, | 710 scratch1, |
| 712 scratch2, | 711 scratch2, |
| 713 result, | 712 result, |
| 714 &miss, // When not a string. | 713 &miss, // When not a string. |
| 715 &miss, // When not a number. | 714 &miss, // When not a number. |
| 716 &index_out_of_range, | 715 &miss, // When index out of range. |
| 717 STRING_INDEX_IS_ARRAY_INDEX); | 716 STRING_INDEX_IS_ARRAY_INDEX); |
| 718 char_at_generator.GenerateFast(masm); | 717 char_at_generator.GenerateFast(masm); |
| 719 __ ret(0); | 718 __ ret(0); |
| 720 | 719 |
| 721 ICRuntimeCallHelper call_helper; | 720 ICRuntimeCallHelper call_helper; |
| 722 char_at_generator.GenerateSlow(masm, call_helper); | 721 char_at_generator.GenerateSlow(masm, call_helper); |
| 723 | 722 |
| 724 __ bind(&index_out_of_range); | |
| 725 __ Set(eax, Immediate(Factory::undefined_value())); | |
| 726 __ ret(0); | |
| 727 | |
| 728 __ bind(&miss); | 723 __ bind(&miss); |
| 729 GenerateMiss(masm); | 724 GenerateMiss(masm); |
| 730 } | 725 } |
| 731 | 726 |
| 732 | 727 |
| 733 void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm, | 728 void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm, |
| 734 ExternalArrayType array_type) { | 729 ExternalArrayType array_type) { |
| 735 // ----------- S t a t e ------------- | 730 // ----------- S t a t e ------------- |
| 736 // -- eax : key | 731 // -- eax : key |
| 737 // -- edx : receiver | 732 // -- edx : receiver |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1936 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); | 1931 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); |
| 1937 __ TailCallExternalReference(ref, 3, 1); | 1932 __ TailCallExternalReference(ref, 3, 1); |
| 1938 } | 1933 } |
| 1939 | 1934 |
| 1940 #undef __ | 1935 #undef __ |
| 1941 | 1936 |
| 1942 | 1937 |
| 1943 } } // namespace v8::internal | 1938 } } // namespace v8::internal |
| 1944 | 1939 |
| 1945 #endif // V8_TARGET_ARCH_IA32 | 1940 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |