OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/s390/codegen-s390.h" | 5 #include "src/s390/codegen-s390.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_S390 | 7 #if V8_TARGET_ARCH_S390 |
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( | 117 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( |
118 MacroAssembler* masm, Register receiver, Register key, Register value, | 118 MacroAssembler* masm, Register receiver, Register key, Register value, |
119 Register target_map, AllocationSiteMode mode, | 119 Register target_map, AllocationSiteMode mode, |
120 Label* allocation_memento_found) { | 120 Label* allocation_memento_found) { |
121 Register scratch_elements = r6; | 121 Register scratch_elements = r6; |
122 DCHECK(!AreAliased(receiver, key, value, target_map, scratch_elements)); | 122 DCHECK(!AreAliased(receiver, key, value, target_map, scratch_elements)); |
123 | 123 |
124 if (mode == TRACK_ALLOCATION_SITE) { | 124 if (mode == TRACK_ALLOCATION_SITE) { |
125 DCHECK(allocation_memento_found != NULL); | 125 DCHECK(allocation_memento_found != NULL); |
126 __ JumpIfJSArrayHasAllocationMemento(receiver, scratch_elements, | 126 __ JumpIfJSArrayHasAllocationMemento(receiver, scratch_elements, r1, |
127 allocation_memento_found); | 127 allocation_memento_found); |
128 } | 128 } |
129 | 129 |
130 // Set transitioned map. | 130 // Set transitioned map. |
131 __ StoreP(target_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 131 __ StoreP(target_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
132 __ RecordWriteField(receiver, HeapObject::kMapOffset, target_map, r1, | 132 __ RecordWriteField(receiver, HeapObject::kMapOffset, target_map, r1, |
133 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, | 133 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
134 OMIT_SMI_CHECK); | 134 OMIT_SMI_CHECK); |
135 } | 135 } |
136 | 136 |
137 void ElementsTransitionGenerator::GenerateSmiToDouble( | 137 void ElementsTransitionGenerator::GenerateSmiToDouble( |
138 MacroAssembler* masm, Register receiver, Register key, Register value, | 138 MacroAssembler* masm, Register receiver, Register key, Register value, |
139 Register target_map, AllocationSiteMode mode, Label* fail) { | 139 Register target_map, AllocationSiteMode mode, Label* fail) { |
140 // lr contains the return address | 140 // lr contains the return address |
141 Label loop, entry, convert_hole, gc_required, only_change_map, done; | 141 Label loop, entry, convert_hole, gc_required, only_change_map, done; |
142 Register elements = r6; | 142 Register elements = r6; |
143 Register length = r7; | 143 Register length = r7; |
144 Register array = r8; | 144 Register array = r8; |
145 Register array_end = array; | 145 Register array_end = array; |
146 | 146 |
147 // target_map parameter can be clobbered. | 147 // target_map parameter can be clobbered. |
148 Register scratch1 = target_map; | 148 Register scratch1 = target_map; |
149 Register scratch2 = r1; | 149 Register scratch2 = r1; |
150 | 150 |
151 // Verify input registers don't conflict with locals. | 151 // Verify input registers don't conflict with locals. |
152 DCHECK(!AreAliased(receiver, key, value, target_map, elements, length, array, | 152 DCHECK(!AreAliased(receiver, key, value, target_map, elements, length, array, |
153 scratch2)); | 153 scratch2)); |
154 | 154 |
155 if (mode == TRACK_ALLOCATION_SITE) { | 155 if (mode == TRACK_ALLOCATION_SITE) { |
156 __ JumpIfJSArrayHasAllocationMemento(receiver, elements, fail); | 156 __ JumpIfJSArrayHasAllocationMemento(receiver, elements, scratch2, fail); |
157 } | 157 } |
158 | 158 |
159 // Check for empty arrays, which only require a map transition and no changes | 159 // Check for empty arrays, which only require a map transition and no changes |
160 // to the backing store. | 160 // to the backing store. |
161 __ LoadP(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 161 __ LoadP(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
162 __ CompareRoot(elements, Heap::kEmptyFixedArrayRootIndex); | 162 __ CompareRoot(elements, Heap::kEmptyFixedArrayRootIndex); |
163 __ beq(&only_change_map, Label::kNear); | 163 __ beq(&only_change_map, Label::kNear); |
164 | 164 |
165 // Preserve lr and use r14 as a temporary register. | 165 // Preserve lr and use r14 as a temporary register. |
166 __ push(r14); | 166 __ push(r14); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 Register length = r7; | 271 Register length = r7; |
272 Register scratch = r1; | 272 Register scratch = r1; |
273 Register scratch3 = r9; | 273 Register scratch3 = r9; |
274 Register hole_value = r9; | 274 Register hole_value = r9; |
275 | 275 |
276 // Verify input registers don't conflict with locals. | 276 // Verify input registers don't conflict with locals. |
277 DCHECK(!AreAliased(receiver, key, value, target_map, elements, array, length, | 277 DCHECK(!AreAliased(receiver, key, value, target_map, elements, array, length, |
278 scratch)); | 278 scratch)); |
279 | 279 |
280 if (mode == TRACK_ALLOCATION_SITE) { | 280 if (mode == TRACK_ALLOCATION_SITE) { |
281 __ JumpIfJSArrayHasAllocationMemento(receiver, elements, fail); | 281 __ JumpIfJSArrayHasAllocationMemento(receiver, elements, scratch3, fail); |
282 } | 282 } |
283 | 283 |
284 // Check for empty arrays, which only require a map transition and no changes | 284 // Check for empty arrays, which only require a map transition and no changes |
285 // to the backing store. | 285 // to the backing store. |
286 __ LoadP(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 286 __ LoadP(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
287 __ CompareRoot(elements, Heap::kEmptyFixedArrayRootIndex); | 287 __ CompareRoot(elements, Heap::kEmptyFixedArrayRootIndex); |
288 __ beq(&only_change_map); | 288 __ beq(&only_change_map); |
289 | 289 |
290 __ Push(target_map, receiver, key, value); | 290 __ Push(target_map, receiver, key, value); |
291 __ LoadP(length, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 291 __ LoadP(length, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 // (kNoCodeAgeSequenceLength - kCodeAgingSequenceLength) bytes. | 666 // (kNoCodeAgeSequenceLength - kCodeAgingSequenceLength) bytes. |
667 patcher.masm()->nop(); // 2-byte nops(). | 667 patcher.masm()->nop(); // 2-byte nops(). |
668 } | 668 } |
669 } | 669 } |
670 } | 670 } |
671 | 671 |
672 } // namespace internal | 672 } // namespace internal |
673 } // namespace v8 | 673 } // namespace v8 |
674 | 674 |
675 #endif // V8_TARGET_ARCH_S390 | 675 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |