OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/x64/codegen-x64.h" | 5 #include "src/x64/codegen-x64.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 STATIC_ASSERT(FixedDoubleArray::kHeaderSize == FixedArray::kHeaderSize); | 197 STATIC_ASSERT(FixedDoubleArray::kHeaderSize == FixedArray::kHeaderSize); |
198 | 198 |
199 Label loop, entry, convert_hole; | 199 Label loop, entry, convert_hole; |
200 __ movq(r15, bit_cast<int64_t, uint64_t>(kHoleNanInt64)); | 200 __ movq(r15, bit_cast<int64_t, uint64_t>(kHoleNanInt64)); |
201 // r15: the-hole NaN | 201 // r15: the-hole NaN |
202 __ jmp(&entry); | 202 __ jmp(&entry); |
203 | 203 |
204 // Allocate new backing store. | 204 // Allocate new backing store. |
205 __ bind(&new_backing_store); | 205 __ bind(&new_backing_store); |
206 __ leap(rdi, Operand(r9, times_8, FixedArray::kHeaderSize)); | 206 __ leap(rdi, Operand(r9, times_8, FixedArray::kHeaderSize)); |
207 __ Allocate(rdi, r14, r11, r15, fail, TAG_OBJECT); | 207 __ Allocate(rdi, r14, r11, r15, fail, NO_ALLOCATION_FLAGS); |
208 // Set backing store's map | 208 // Set backing store's map |
209 __ LoadRoot(rdi, Heap::kFixedDoubleArrayMapRootIndex); | 209 __ LoadRoot(rdi, Heap::kFixedDoubleArrayMapRootIndex); |
210 __ movp(FieldOperand(r14, HeapObject::kMapOffset), rdi); | 210 __ movp(FieldOperand(r14, HeapObject::kMapOffset), rdi); |
211 // Set receiver's backing store. | 211 // Set receiver's backing store. |
212 __ movp(FieldOperand(rdx, JSObject::kElementsOffset), r14); | 212 __ movp(FieldOperand(rdx, JSObject::kElementsOffset), r14); |
213 __ movp(r11, r14); | 213 __ movp(r11, r14); |
214 __ RecordWriteField(rdx, | 214 __ RecordWriteField(rdx, |
215 JSObject::kElementsOffset, | 215 JSObject::kElementsOffset, |
216 r11, | 216 r11, |
217 r15, | 217 r15, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 __ j(equal, &only_change_map); | 289 __ j(equal, &only_change_map); |
290 | 290 |
291 __ Push(rsi); | 291 __ Push(rsi); |
292 __ Push(rax); | 292 __ Push(rax); |
293 | 293 |
294 __ movp(r8, FieldOperand(rdx, JSObject::kElementsOffset)); | 294 __ movp(r8, FieldOperand(rdx, JSObject::kElementsOffset)); |
295 __ SmiToInteger32(r9, FieldOperand(r8, FixedDoubleArray::kLengthOffset)); | 295 __ SmiToInteger32(r9, FieldOperand(r8, FixedDoubleArray::kLengthOffset)); |
296 // r8 : source FixedDoubleArray | 296 // r8 : source FixedDoubleArray |
297 // r9 : number of elements | 297 // r9 : number of elements |
298 __ leap(rdi, Operand(r9, times_pointer_size, FixedArray::kHeaderSize)); | 298 __ leap(rdi, Operand(r9, times_pointer_size, FixedArray::kHeaderSize)); |
299 __ Allocate(rdi, r11, r14, r15, &gc_required, TAG_OBJECT); | 299 __ Allocate(rdi, r11, r14, r15, &gc_required, NO_ALLOCATION_FLAGS); |
300 // r11: destination FixedArray | 300 // r11: destination FixedArray |
301 __ LoadRoot(rdi, Heap::kFixedArrayMapRootIndex); | 301 __ LoadRoot(rdi, Heap::kFixedArrayMapRootIndex); |
302 __ movp(FieldOperand(r11, HeapObject::kMapOffset), rdi); | 302 __ movp(FieldOperand(r11, HeapObject::kMapOffset), rdi); |
303 __ Integer32ToSmi(r14, r9); | 303 __ Integer32ToSmi(r14, r9); |
304 __ movp(FieldOperand(r11, FixedArray::kLengthOffset), r14); | 304 __ movp(FieldOperand(r11, FixedArray::kLengthOffset), r14); |
305 | 305 |
306 // Prepare for conversion loop. | 306 // Prepare for conversion loop. |
307 __ movq(rsi, bit_cast<int64_t, uint64_t>(kHoleNanInt64)); | 307 __ movq(rsi, bit_cast<int64_t, uint64_t>(kHoleNanInt64)); |
308 __ LoadRoot(rdi, Heap::kTheHoleValueRootIndex); | 308 __ LoadRoot(rdi, Heap::kTheHoleValueRootIndex); |
309 // rsi: the-hole NaN | 309 // rsi: the-hole NaN |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 return Operand(base_reg_, argument_count_reg_, times_pointer_size, | 634 return Operand(base_reg_, argument_count_reg_, times_pointer_size, |
635 displacement_to_last_argument + (receiver - 1 - index) * kPointerSize); | 635 displacement_to_last_argument + (receiver - 1 - index) * kPointerSize); |
636 } | 636 } |
637 } | 637 } |
638 | 638 |
639 | 639 |
640 } // namespace internal | 640 } // namespace internal |
641 } // namespace v8 | 641 } // namespace v8 |
642 | 642 |
643 #endif // V8_TARGET_ARCH_X64 | 643 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |