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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 __ LoadRoot(rcx, Heap::kFixedArrayMapRootIndex); | 346 __ LoadRoot(rcx, Heap::kFixedArrayMapRootIndex); |
347 __ movp(Operand(rdi, HeapObject::kMapOffset), rcx); // setup the map | 347 __ movp(Operand(rdi, HeapObject::kMapOffset), rcx); // setup the map |
348 __ Integer32ToSmi(rdx, rdx); | 348 __ Integer32ToSmi(rdx, rdx); |
349 __ movp(Operand(rdi, FixedArray::kLengthOffset), rdx); // and length | 349 __ movp(Operand(rdi, FixedArray::kLengthOffset), rdx); // and length |
350 | 350 |
351 // Initialize the fields to undefined. | 351 // Initialize the fields to undefined. |
352 // rbx: JSObject | 352 // rbx: JSObject |
353 // rdi: FixedArray | 353 // rdi: FixedArray |
354 // rax: start of next object | 354 // rax: start of next object |
355 // rdx: number of elements | 355 // rdx: number of elements |
356 { Label loop, entry; | 356 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); |
357 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); | 357 __ leap(rcx, Operand(rdi, FixedArray::kHeaderSize)); |
358 __ leap(rcx, Operand(rdi, FixedArray::kHeaderSize)); | 358 __ InitializeFieldsWithFiller(rcx, rax, rdx); |
359 __ jmp(&entry); | |
360 __ bind(&loop); | |
361 __ movp(Operand(rcx, 0), rdx); | |
362 __ addp(rcx, Immediate(kPointerSize)); | |
363 __ bind(&entry); | |
364 __ cmpp(rcx, rax); | |
365 __ j(below, &loop); | |
366 } | |
367 | 359 |
368 // Store the initialized FixedArray into the properties field of | 360 // Store the initialized FixedArray into the properties field of |
369 // the JSObject | 361 // the JSObject |
370 // rbx: JSObject | 362 // rbx: JSObject |
371 // rdi: FixedArray | 363 // rdi: FixedArray |
372 __ orp(rdi, Immediate(kHeapObjectTag)); // add the heap tag | 364 __ orp(rdi, Immediate(kHeapObjectTag)); // add the heap tag |
373 __ movp(FieldOperand(rbx, JSObject::kPropertiesOffset), rdi); | 365 __ movp(FieldOperand(rbx, JSObject::kPropertiesOffset), rdi); |
374 | 366 |
375 | 367 |
376 // Continue with JSObject being successfully allocated | 368 // Continue with JSObject being successfully allocated |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 __ ret(0); | 1776 __ ret(0); |
1785 } | 1777 } |
1786 | 1778 |
1787 | 1779 |
1788 #undef __ | 1780 #undef __ |
1789 | 1781 |
1790 } // namespace internal | 1782 } // namespace internal |
1791 } // namespace v8 | 1783 } // namespace v8 |
1792 | 1784 |
1793 #endif // V8_TARGET_ARCH_X64 | 1785 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |