OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/ppc/codegen-ppc.h" | 5 #include "src/ppc/codegen-ppc.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( | 130 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( |
131 MacroAssembler* masm, Register receiver, Register key, Register value, | 131 MacroAssembler* masm, Register receiver, Register key, Register value, |
132 Register target_map, AllocationSiteMode mode, | 132 Register target_map, AllocationSiteMode mode, |
133 Label* allocation_memento_found) { | 133 Label* allocation_memento_found) { |
134 Register scratch_elements = r7; | 134 Register scratch_elements = r7; |
135 DCHECK(!AreAliased(receiver, key, value, target_map, scratch_elements)); | 135 DCHECK(!AreAliased(receiver, key, value, target_map, scratch_elements)); |
136 | 136 |
137 if (mode == TRACK_ALLOCATION_SITE) { | 137 if (mode == TRACK_ALLOCATION_SITE) { |
138 DCHECK(allocation_memento_found != NULL); | 138 DCHECK(allocation_memento_found != NULL); |
139 __ JumpIfJSArrayHasAllocationMemento(receiver, scratch_elements, | 139 __ JumpIfJSArrayHasAllocationMemento(receiver, scratch_elements, r11, |
140 allocation_memento_found); | 140 allocation_memento_found); |
141 } | 141 } |
142 | 142 |
143 // Set transitioned map. | 143 // Set transitioned map. |
144 __ StoreP(target_map, FieldMemOperand(receiver, HeapObject::kMapOffset), r0); | 144 __ StoreP(target_map, FieldMemOperand(receiver, HeapObject::kMapOffset), r0); |
145 __ RecordWriteField(receiver, HeapObject::kMapOffset, target_map, r11, | 145 __ RecordWriteField(receiver, HeapObject::kMapOffset, target_map, r11, |
146 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, | 146 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
147 OMIT_SMI_CHECK); | 147 OMIT_SMI_CHECK); |
148 } | 148 } |
149 | 149 |
(...skipping 12 matching lines...) Expand all Loading... |
162 Register scratch1 = target_map; | 162 Register scratch1 = target_map; |
163 Register scratch2 = r10; | 163 Register scratch2 = r10; |
164 Register scratch3 = r11; | 164 Register scratch3 = r11; |
165 Register scratch4 = r14; | 165 Register scratch4 = r14; |
166 | 166 |
167 // Verify input registers don't conflict with locals. | 167 // Verify input registers don't conflict with locals. |
168 DCHECK(!AreAliased(receiver, key, value, target_map, elements, length, array, | 168 DCHECK(!AreAliased(receiver, key, value, target_map, elements, length, array, |
169 scratch2)); | 169 scratch2)); |
170 | 170 |
171 if (mode == TRACK_ALLOCATION_SITE) { | 171 if (mode == TRACK_ALLOCATION_SITE) { |
172 __ JumpIfJSArrayHasAllocationMemento(receiver, elements, fail); | 172 __ JumpIfJSArrayHasAllocationMemento(receiver, elements, scratch3, fail); |
173 } | 173 } |
174 | 174 |
175 // Check for empty arrays, which only require a map transition and no changes | 175 // Check for empty arrays, which only require a map transition and no changes |
176 // to the backing store. | 176 // to the backing store. |
177 __ LoadP(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 177 __ LoadP(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
178 __ CompareRoot(elements, Heap::kEmptyFixedArrayRootIndex); | 178 __ CompareRoot(elements, Heap::kEmptyFixedArrayRootIndex); |
179 __ beq(&only_change_map); | 179 __ beq(&only_change_map); |
180 | 180 |
181 __ LoadP(length, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 181 __ LoadP(length, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
182 // length: number of elements (smi-tagged) | 182 // length: number of elements (smi-tagged) |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 Register length = r8; | 282 Register length = r8; |
283 Register scratch = r10; | 283 Register scratch = r10; |
284 Register scratch3 = r11; | 284 Register scratch3 = r11; |
285 Register hole_value = r14; | 285 Register hole_value = r14; |
286 | 286 |
287 // Verify input registers don't conflict with locals. | 287 // Verify input registers don't conflict with locals. |
288 DCHECK(!AreAliased(receiver, key, value, target_map, elements, array, length, | 288 DCHECK(!AreAliased(receiver, key, value, target_map, elements, array, length, |
289 scratch)); | 289 scratch)); |
290 | 290 |
291 if (mode == TRACK_ALLOCATION_SITE) { | 291 if (mode == TRACK_ALLOCATION_SITE) { |
292 __ JumpIfJSArrayHasAllocationMemento(receiver, elements, fail); | 292 __ JumpIfJSArrayHasAllocationMemento(receiver, elements, scratch3, fail); |
293 } | 293 } |
294 | 294 |
295 // Check for empty arrays, which only require a map transition and no changes | 295 // Check for empty arrays, which only require a map transition and no changes |
296 // to the backing store. | 296 // to the backing store. |
297 __ LoadP(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 297 __ LoadP(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
298 __ CompareRoot(elements, Heap::kEmptyFixedArrayRootIndex); | 298 __ CompareRoot(elements, Heap::kEmptyFixedArrayRootIndex); |
299 __ beq(&only_change_map); | 299 __ beq(&only_change_map); |
300 | 300 |
301 __ Push(target_map, receiver, key, value); | 301 __ Push(target_map, receiver, key, value); |
302 __ LoadP(length, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 302 __ LoadP(length, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 patcher.masm()->Jump(r3); | 672 patcher.masm()->Jump(r3); |
673 for (int i = 0; i < kCodeAgingSequenceNops; i++) { | 673 for (int i = 0; i < kCodeAgingSequenceNops; i++) { |
674 patcher.masm()->nop(); | 674 patcher.masm()->nop(); |
675 } | 675 } |
676 } | 676 } |
677 } | 677 } |
678 } // namespace internal | 678 } // namespace internal |
679 } // namespace v8 | 679 } // namespace v8 |
680 | 680 |
681 #endif // V8_TARGET_ARCH_PPC | 681 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |