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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // Probe the string dictionary in the |elements| register. Jump to the | 108 // Probe the string dictionary in the |elements| register. Jump to the |
109 // |done| label if a property with the given name is found. Jump to | 109 // |done| label if a property with the given name is found. Jump to |
110 // the |miss| label otherwise. | 110 // the |miss| label otherwise. |
111 static void GenerateStringDictionaryProbes(MacroAssembler* masm, | 111 static void GenerateStringDictionaryProbes(MacroAssembler* masm, |
112 Label* miss, | 112 Label* miss, |
113 Label* done, | 113 Label* done, |
114 Register elements, | 114 Register elements, |
115 Register name, | 115 Register name, |
116 Register scratch1, | 116 Register scratch1, |
117 Register scratch2) { | 117 Register scratch2) { |
| 118 // Assert that name contains a string. |
| 119 if (FLAG_debug_code) __ AbortIfNotString(name); |
| 120 |
118 // Compute the capacity mask. | 121 // Compute the capacity mask. |
119 const int kCapacityOffset = StringDictionary::kHeaderSize + | 122 const int kCapacityOffset = StringDictionary::kHeaderSize + |
120 StringDictionary::kCapacityIndex * kPointerSize; | 123 StringDictionary::kCapacityIndex * kPointerSize; |
121 __ ldr(scratch1, FieldMemOperand(elements, kCapacityOffset)); | 124 __ ldr(scratch1, FieldMemOperand(elements, kCapacityOffset)); |
122 __ mov(scratch1, Operand(scratch1, ASR, kSmiTagSize)); // convert smi to int | 125 __ mov(scratch1, Operand(scratch1, ASR, kSmiTagSize)); // convert smi to int |
123 __ sub(scratch1, scratch1, Operand(1)); | 126 __ sub(scratch1, scratch1, Operand(1)); |
124 | 127 |
125 const int kElementsStartOffset = StringDictionary::kHeaderSize + | 128 const int kElementsStartOffset = StringDictionary::kHeaderSize + |
126 StringDictionary::kElementsStartIndex * kPointerSize; | 129 StringDictionary::kElementsStartIndex * kPointerSize; |
127 | 130 |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 __ jmp(&index_smi); | 834 __ jmp(&index_smi); |
832 } | 835 } |
833 | 836 |
834 | 837 |
835 void KeyedCallIC::GenerateNormal(MacroAssembler* masm, int argc) { | 838 void KeyedCallIC::GenerateNormal(MacroAssembler* masm, int argc) { |
836 // ----------- S t a t e ------------- | 839 // ----------- S t a t e ------------- |
837 // -- r2 : name | 840 // -- r2 : name |
838 // -- lr : return address | 841 // -- lr : return address |
839 // ----------------------------------- | 842 // ----------------------------------- |
840 | 843 |
| 844 // Check if the name is a string. |
| 845 Label miss; |
| 846 __ tst(r2, Operand(kSmiTagMask)); |
| 847 __ b(eq, &miss); |
| 848 Condition cond = masm->IsObjectStringType(r2, r0); |
| 849 __ b(NegateCondition(cond), &miss); |
| 850 |
841 GenerateCallNormal(masm, argc); | 851 GenerateCallNormal(masm, argc); |
| 852 __ bind(&miss); |
842 GenerateMiss(masm, argc); | 853 GenerateMiss(masm, argc); |
843 } | 854 } |
844 | 855 |
845 | 856 |
846 // Defined in ic.cc. | 857 // Defined in ic.cc. |
847 Object* LoadIC_Miss(Arguments args); | 858 Object* LoadIC_Miss(Arguments args); |
848 | 859 |
849 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | 860 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
850 // ----------- S t a t e ------------- | 861 // ----------- S t a t e ------------- |
851 // -- r2 : name | 862 // -- r2 : name |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2306 GenerateMiss(masm); | 2317 GenerateMiss(masm); |
2307 } | 2318 } |
2308 | 2319 |
2309 | 2320 |
2310 #undef __ | 2321 #undef __ |
2311 | 2322 |
2312 | 2323 |
2313 } } // namespace v8::internal | 2324 } } // namespace v8::internal |
2314 | 2325 |
2315 #endif // V8_TARGET_ARCH_ARM | 2326 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |