OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 masm->set_has_frame(false); | 137 masm->set_has_frame(false); |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 // ------------------------------------------------------------------------- | 141 // ------------------------------------------------------------------------- |
142 // Code generators | 142 // Code generators |
143 | 143 |
144 #define __ ACCESS_MASM(masm) | 144 #define __ ACCESS_MASM(masm) |
145 | 145 |
146 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( | 146 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( |
147 MacroAssembler* masm) { | 147 MacroAssembler* masm, AllocationSiteMode mode, |
| 148 Label* allocation_site_info_found) { |
148 // ----------- S t a t e ------------- | 149 // ----------- S t a t e ------------- |
149 // -- r0 : value | 150 // -- r0 : value |
150 // -- r1 : key | 151 // -- r1 : key |
151 // -- r2 : receiver | 152 // -- r2 : receiver |
152 // -- lr : return address | 153 // -- lr : return address |
153 // -- r3 : target map, scratch for subsequent call | 154 // -- r3 : target map, scratch for subsequent call |
154 // -- r4 : scratch (elements) | 155 // -- r4 : scratch (elements) |
155 // ----------------------------------- | 156 // ----------------------------------- |
| 157 if (mode == TRACK_ALLOCATION_SITE) { |
| 158 ASSERT(allocation_site_info_found != NULL); |
| 159 masm->TestJSArrayForAllocationSiteInfo(r2, r4, |
| 160 allocation_site_info_found); |
| 161 } |
| 162 |
156 // Set transitioned map. | 163 // Set transitioned map. |
157 __ str(r3, FieldMemOperand(r2, HeapObject::kMapOffset)); | 164 __ str(r3, FieldMemOperand(r2, HeapObject::kMapOffset)); |
158 __ RecordWriteField(r2, | 165 __ RecordWriteField(r2, |
159 HeapObject::kMapOffset, | 166 HeapObject::kMapOffset, |
160 r3, | 167 r3, |
161 r9, | 168 r9, |
162 kLRHasNotBeenSaved, | 169 kLRHasNotBeenSaved, |
163 kDontSaveFPRegs, | 170 kDontSaveFPRegs, |
164 EMIT_REMEMBERED_SET, | 171 EMIT_REMEMBERED_SET, |
165 OMIT_SMI_CHECK); | 172 OMIT_SMI_CHECK); |
166 } | 173 } |
167 | 174 |
168 | 175 |
169 void ElementsTransitionGenerator::GenerateSmiToDouble( | 176 void ElementsTransitionGenerator::GenerateSmiToDouble( |
170 MacroAssembler* masm, Label* fail) { | 177 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { |
171 // ----------- S t a t e ------------- | 178 // ----------- S t a t e ------------- |
172 // -- r0 : value | 179 // -- r0 : value |
173 // -- r1 : key | 180 // -- r1 : key |
174 // -- r2 : receiver | 181 // -- r2 : receiver |
175 // -- lr : return address | 182 // -- lr : return address |
176 // -- r3 : target map, scratch for subsequent call | 183 // -- r3 : target map, scratch for subsequent call |
177 // -- r4 : scratch (elements) | 184 // -- r4 : scratch (elements) |
178 // ----------------------------------- | 185 // ----------------------------------- |
179 Label loop, entry, convert_hole, gc_required, only_change_map, done; | 186 Label loop, entry, convert_hole, gc_required, only_change_map, done; |
180 bool vfp2_supported = CpuFeatures::IsSupported(VFP2); | 187 bool vfp2_supported = CpuFeatures::IsSupported(VFP2); |
181 | 188 |
182 if (FLAG_track_allocation_sites) { | 189 if (mode == TRACK_ALLOCATION_SITE) { |
183 masm->TestJSArrayForAllocationSiteInfo(r2, r4, fail); | 190 masm->TestJSArrayForAllocationSiteInfo(r2, r4, fail); |
184 } | 191 } |
185 | 192 |
186 // Check for empty arrays, which only require a map transition and no changes | 193 // Check for empty arrays, which only require a map transition and no changes |
187 // to the backing store. | 194 // to the backing store. |
188 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); | 195 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); |
189 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); | 196 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); |
190 __ b(eq, &only_change_map); | 197 __ b(eq, &only_change_map); |
191 | 198 |
192 __ push(lr); | 199 __ push(lr); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 __ cmp(r7, r6); | 308 __ cmp(r7, r6); |
302 __ b(lt, &loop); | 309 __ b(lt, &loop); |
303 | 310 |
304 if (!vfp2_supported) __ Pop(r1, r0); | 311 if (!vfp2_supported) __ Pop(r1, r0); |
305 __ pop(lr); | 312 __ pop(lr); |
306 __ bind(&done); | 313 __ bind(&done); |
307 } | 314 } |
308 | 315 |
309 | 316 |
310 void ElementsTransitionGenerator::GenerateDoubleToObject( | 317 void ElementsTransitionGenerator::GenerateDoubleToObject( |
311 MacroAssembler* masm, Label* fail) { | 318 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { |
312 // ----------- S t a t e ------------- | 319 // ----------- S t a t e ------------- |
313 // -- r0 : value | 320 // -- r0 : value |
314 // -- r1 : key | 321 // -- r1 : key |
315 // -- r2 : receiver | 322 // -- r2 : receiver |
316 // -- lr : return address | 323 // -- lr : return address |
317 // -- r3 : target map, scratch for subsequent call | 324 // -- r3 : target map, scratch for subsequent call |
318 // -- r4 : scratch (elements) | 325 // -- r4 : scratch (elements) |
319 // ----------------------------------- | 326 // ----------------------------------- |
320 Label entry, loop, convert_hole, gc_required, only_change_map; | 327 Label entry, loop, convert_hole, gc_required, only_change_map; |
321 | 328 |
| 329 if (mode == TRACK_ALLOCATION_SITE) { |
| 330 masm->TestJSArrayForAllocationSiteInfo(r2, r4, fail); |
| 331 } |
| 332 |
322 // Check for empty arrays, which only require a map transition and no changes | 333 // Check for empty arrays, which only require a map transition and no changes |
323 // to the backing store. | 334 // to the backing store. |
324 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); | 335 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); |
325 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); | 336 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); |
326 __ b(eq, &only_change_map); | 337 __ b(eq, &only_change_map); |
327 | 338 |
328 __ push(lr); | 339 __ push(lr); |
329 __ Push(r3, r2, r1, r0); | 340 __ Push(r3, r2, r1, r0); |
330 __ ldr(r5, FieldMemOperand(r4, FixedArray::kLengthOffset)); | 341 __ ldr(r5, FieldMemOperand(r4, FixedArray::kLengthOffset)); |
331 // r4: source FixedDoubleArray | 342 // r4: source FixedDoubleArray |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 patcher.masm()->add(r0, pc, Operand(-8)); | 696 patcher.masm()->add(r0, pc, Operand(-8)); |
686 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 697 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
687 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); | 698 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); |
688 } | 699 } |
689 } | 700 } |
690 | 701 |
691 | 702 |
692 } } // namespace v8::internal | 703 } } // namespace v8::internal |
693 | 704 |
694 #endif // V8_TARGET_ARCH_ARM | 705 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |