OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 return true; | 675 return true; |
676 } | 676 } |
677 | 677 |
678 | 678 |
679 Object* KeyedLoadIC_Miss(Arguments args); | 679 Object* KeyedLoadIC_Miss(Arguments args); |
680 | 680 |
681 | 681 |
682 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 682 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
683 // ---------- S t a t e -------------- | 683 // ---------- S t a t e -------------- |
684 // -- lr : return address | 684 // -- lr : return address |
| 685 // -- r0 : key |
685 // -- sp[0] : key | 686 // -- sp[0] : key |
686 // -- sp[4] : receiver | 687 // -- sp[4] : receiver |
687 // ----------------------------------- | 688 // ----------------------------------- |
688 | 689 |
689 __ ldm(ia, sp, r2.bit() | r3.bit()); | 690 __ ldr(r1, MemOperand(sp, kPointerSize)); |
690 __ Push(r3, r2); | 691 __ Push(r1, r0); |
691 | 692 |
692 ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss)); | 693 ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss)); |
693 __ TailCallExternalReference(ref, 2, 1); | 694 __ TailCallExternalReference(ref, 2, 1); |
694 } | 695 } |
695 | 696 |
696 | 697 |
697 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 698 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
698 // ---------- S t a t e -------------- | 699 // ---------- S t a t e -------------- |
699 // -- lr : return address | 700 // -- lr : return address |
| 701 // -- r0 : key |
700 // -- sp[0] : key | 702 // -- sp[0] : key |
701 // -- sp[4] : receiver | 703 // -- sp[4] : receiver |
702 // ----------------------------------- | 704 // ----------------------------------- |
703 | 705 |
704 __ ldm(ia, sp, r2.bit() | r3.bit()); | 706 __ ldr(r1, MemOperand(sp, kPointerSize)); |
705 __ Push(r3, r2); | 707 __ Push(r1, r0); |
706 | 708 |
707 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); | 709 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
708 } | 710 } |
709 | 711 |
710 | 712 |
711 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { | 713 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { |
712 // ---------- S t a t e -------------- | 714 // ---------- S t a t e -------------- |
713 // -- lr : return address | 715 // -- lr : return address |
| 716 // -- r0 : key |
714 // -- sp[0] : key | 717 // -- sp[0] : key |
715 // -- sp[4] : receiver | 718 // -- sp[4] : receiver |
716 // ----------------------------------- | 719 // ----------------------------------- |
717 Label slow, fast, check_pixel_array, check_number_dictionary; | 720 Label slow, fast, check_pixel_array, check_number_dictionary; |
718 | 721 |
719 // Get the key and receiver object from the stack. | 722 // Get the object from the stack. |
720 __ ldm(ia, sp, r0.bit() | r1.bit()); | 723 __ ldr(r1, MemOperand(sp, kPointerSize)); |
721 | 724 |
722 // Check that the object isn't a smi. | 725 // Check that the object isn't a smi. |
723 __ BranchOnSmi(r1, &slow); | 726 __ BranchOnSmi(r1, &slow); |
724 // Get the map of the receiver. | 727 // Get the map of the receiver. |
725 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); | 728 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); |
726 // Check bit field. | 729 // Check bit field. |
727 __ ldrb(r3, FieldMemOperand(r2, Map::kBitFieldOffset)); | 730 __ ldrb(r3, FieldMemOperand(r2, Map::kBitFieldOffset)); |
728 __ tst(r3, Operand(kSlowCaseBitFieldMask)); | 731 __ tst(r3, Operand(kSlowCaseBitFieldMask)); |
729 __ b(ne, &slow); | 732 __ b(ne, &slow); |
730 // Check that the object is some kind of JS object EXCEPT JS Value type. | 733 // Check that the object is some kind of JS object EXCEPT JS Value type. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 // r2: key | 786 // r2: key |
784 __ LoadRoot(ip, Heap::kHashTableMapRootIndex); | 787 __ LoadRoot(ip, Heap::kHashTableMapRootIndex); |
785 __ cmp(r3, ip); | 788 __ cmp(r3, ip); |
786 __ b(ne, &slow); | 789 __ b(ne, &slow); |
787 GenerateNumberDictionaryLoad(masm, &slow, r1, r2, r0, r3, r4); | 790 GenerateNumberDictionaryLoad(masm, &slow, r1, r2, r0, r3, r4); |
788 __ Ret(); | 791 __ Ret(); |
789 | 792 |
790 // Slow case: Push extra copies of the arguments (2). | 793 // Slow case: Push extra copies of the arguments (2). |
791 __ bind(&slow); | 794 __ bind(&slow); |
792 __ IncrementCounter(&Counters::keyed_load_generic_slow, 1, r0, r1); | 795 __ IncrementCounter(&Counters::keyed_load_generic_slow, 1, r0, r1); |
| 796 __ ldr(r0, MemOperand(sp, 0)); |
793 GenerateRuntimeGetProperty(masm); | 797 GenerateRuntimeGetProperty(masm); |
794 } | 798 } |
795 | 799 |
796 | 800 |
797 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { | 801 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { |
798 // ---------- S t a t e -------------- | 802 // ---------- S t a t e -------------- |
799 // -- lr : return address | 803 // -- lr : return address |
| 804 // -- r0 : key |
800 // -- sp[0] : key | 805 // -- sp[0] : key |
801 // -- sp[4] : receiver | 806 // -- sp[4] : receiver |
802 // ----------------------------------- | 807 // ----------------------------------- |
803 Label miss; | 808 Label miss; |
804 Label index_not_smi; | 809 Label index_not_smi; |
805 Label index_out_of_range; | 810 Label index_out_of_range; |
806 Label slow_char_code; | 811 Label slow_char_code; |
807 Label got_char_code; | 812 Label got_char_code; |
808 | 813 |
809 // Get the key and receiver object from the stack. | 814 // Get the object from the stack. |
810 __ ldm(ia, sp, r0.bit() | r1.bit()); | 815 __ ldr(r1, MemOperand(sp, kPointerSize)); |
811 | 816 |
812 Register object = r1; | 817 Register object = r1; |
813 Register index = r0; | 818 Register index = r0; |
814 Register code = r2; | 819 Register code = r2; |
815 Register scratch = r3; | 820 Register scratch = r3; |
816 | 821 |
817 StringHelper::GenerateFastCharCodeAt(masm, | 822 StringHelper::GenerateFastCharCodeAt(masm, |
818 object, | 823 object, |
819 index, | 824 index, |
820 scratch, | 825 scratch, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 if (!(biased_exponent & 1)) { | 905 if (!(biased_exponent & 1)) { |
901 __ bic(hiword, hiword, Operand(1 << HeapNumber::kExponentShift)); | 906 __ bic(hiword, hiword, Operand(1 << HeapNumber::kExponentShift)); |
902 } | 907 } |
903 } | 908 } |
904 | 909 |
905 | 910 |
906 void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm, | 911 void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm, |
907 ExternalArrayType array_type) { | 912 ExternalArrayType array_type) { |
908 // ---------- S t a t e -------------- | 913 // ---------- S t a t e -------------- |
909 // -- lr : return address | 914 // -- lr : return address |
| 915 // -- r0 : key |
910 // -- sp[0] : key | 916 // -- sp[0] : key |
911 // -- sp[4] : receiver | 917 // -- sp[4] : receiver |
912 // ----------------------------------- | 918 // ----------------------------------- |
913 Label slow, failed_allocation; | 919 Label slow, failed_allocation; |
914 | 920 |
915 // Get the key and receiver object from the stack. | 921 // Get the object from the stack. |
916 __ ldm(ia, sp, r0.bit() | r1.bit()); | 922 __ ldr(r1, MemOperand(sp, kPointerSize)); |
917 | 923 |
918 // r0: key | 924 // r0: key |
919 // r1: receiver object | 925 // r1: receiver object |
920 | 926 |
921 // Check that the object isn't a smi | 927 // Check that the object isn't a smi |
922 __ BranchOnSmi(r1, &slow); | 928 __ BranchOnSmi(r1, &slow); |
923 | 929 |
924 // Check that the key is a smi. | 930 // Check that the key is a smi. |
925 __ BranchOnNotSmi(r0, &slow); | 931 __ BranchOnNotSmi(r0, &slow); |
926 | 932 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 } | 1142 } |
1137 | 1143 |
1138 } else { | 1144 } else { |
1139 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); | 1145 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
1140 __ Ret(); | 1146 __ Ret(); |
1141 } | 1147 } |
1142 | 1148 |
1143 // Slow case: Load name and receiver from stack and jump to runtime. | 1149 // Slow case: Load name and receiver from stack and jump to runtime. |
1144 __ bind(&slow); | 1150 __ bind(&slow); |
1145 __ IncrementCounter(&Counters::keyed_load_external_array_slow, 1, r0, r1); | 1151 __ IncrementCounter(&Counters::keyed_load_external_array_slow, 1, r0, r1); |
| 1152 __ ldr(r0, MemOperand(sp, 0)); |
1146 GenerateRuntimeGetProperty(masm); | 1153 GenerateRuntimeGetProperty(masm); |
1147 } | 1154 } |
1148 | 1155 |
1149 | 1156 |
1150 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 1157 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
1151 // ---------- S t a t e -------------- | 1158 // ---------- S t a t e -------------- |
1152 // -- lr : return address | 1159 // -- lr : return address |
| 1160 // -- r0 : key |
1153 // -- sp[0] : key | 1161 // -- sp[0] : key |
1154 // -- sp[4] : receiver | 1162 // -- sp[4] : receiver |
1155 // ----------------------------------- | 1163 // ----------------------------------- |
1156 Label slow; | 1164 Label slow; |
1157 | 1165 |
1158 // Get the key and receiver object from the stack. | 1166 // Get the object from the stack. |
1159 __ ldm(ia, sp, r0.bit() | r1.bit()); | 1167 __ ldr(r1, MemOperand(sp, kPointerSize)); |
1160 | 1168 |
1161 // Check that the receiver isn't a smi. | 1169 // Check that the receiver isn't a smi. |
1162 __ BranchOnSmi(r1, &slow); | 1170 __ BranchOnSmi(r1, &slow); |
1163 | 1171 |
1164 // Check that the key is a smi. | 1172 // Check that the key is a smi. |
1165 __ BranchOnNotSmi(r0, &slow); | 1173 __ BranchOnNotSmi(r0, &slow); |
1166 | 1174 |
1167 // Get the map of the receiver. | 1175 // Get the map of the receiver. |
1168 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); | 1176 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); |
1169 | 1177 |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 __ bind(&miss); | 1824 __ bind(&miss); |
1817 | 1825 |
1818 GenerateMiss(masm); | 1826 GenerateMiss(masm); |
1819 } | 1827 } |
1820 | 1828 |
1821 | 1829 |
1822 #undef __ | 1830 #undef __ |
1823 | 1831 |
1824 | 1832 |
1825 } } // namespace v8::internal | 1833 } } // namespace v8::internal |
OLD | NEW |