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/ia32/codegen-ia32.h" | 5 #include "src/ia32/codegen-ia32.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 __ j(equal, &only_change_map); | 579 __ j(equal, &only_change_map); |
580 | 580 |
581 __ push(eax); | 581 __ push(eax); |
582 __ push(ebx); | 582 __ push(ebx); |
583 | 583 |
584 __ mov(edi, FieldOperand(edi, FixedArray::kLengthOffset)); | 584 __ mov(edi, FieldOperand(edi, FixedArray::kLengthOffset)); |
585 | 585 |
586 // Allocate new FixedDoubleArray. | 586 // Allocate new FixedDoubleArray. |
587 // edx: receiver | 587 // edx: receiver |
588 // edi: length of source FixedArray (smi-tagged) | 588 // edi: length of source FixedArray (smi-tagged) |
589 AllocationFlags flags = | 589 AllocationFlags flags = static_cast<AllocationFlags>(DOUBLE_ALIGNMENT); |
590 static_cast<AllocationFlags>(TAG_OBJECT | DOUBLE_ALIGNMENT); | |
591 __ Allocate(FixedDoubleArray::kHeaderSize, times_8, edi, | 590 __ Allocate(FixedDoubleArray::kHeaderSize, times_8, edi, |
592 REGISTER_VALUE_IS_SMI, eax, ebx, no_reg, &gc_required, flags); | 591 REGISTER_VALUE_IS_SMI, eax, ebx, no_reg, &gc_required, flags); |
593 | 592 |
594 // eax: destination FixedDoubleArray | 593 // eax: destination FixedDoubleArray |
595 // edi: number of elements | 594 // edi: number of elements |
596 // edx: receiver | 595 // edx: receiver |
597 __ mov(FieldOperand(eax, HeapObject::kMapOffset), | 596 __ mov(FieldOperand(eax, HeapObject::kMapOffset), |
598 Immediate(masm->isolate()->factory()->fixed_double_array_map())); | 597 Immediate(masm->isolate()->factory()->fixed_double_array_map())); |
599 __ mov(FieldOperand(eax, FixedDoubleArray::kLengthOffset), edi); | 598 __ mov(FieldOperand(eax, FixedDoubleArray::kLengthOffset), edi); |
600 __ mov(esi, FieldOperand(edx, JSObject::kElementsOffset)); | 599 __ mov(esi, FieldOperand(edx, JSObject::kElementsOffset)); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 __ push(esi); | 706 __ push(esi); |
708 __ push(eax); | 707 __ push(eax); |
709 __ push(edx); | 708 __ push(edx); |
710 __ push(ebx); | 709 __ push(ebx); |
711 | 710 |
712 __ mov(ebx, FieldOperand(edi, FixedDoubleArray::kLengthOffset)); | 711 __ mov(ebx, FieldOperand(edi, FixedDoubleArray::kLengthOffset)); |
713 | 712 |
714 // Allocate new FixedArray. | 713 // Allocate new FixedArray. |
715 // ebx: length of source FixedDoubleArray (smi-tagged) | 714 // ebx: length of source FixedDoubleArray (smi-tagged) |
716 __ lea(edi, Operand(ebx, times_2, FixedArray::kHeaderSize)); | 715 __ lea(edi, Operand(ebx, times_2, FixedArray::kHeaderSize)); |
717 __ Allocate(edi, eax, esi, no_reg, &gc_required, TAG_OBJECT); | 716 __ Allocate(edi, eax, esi, no_reg, &gc_required, NO_ALLOCATION_FLAGS); |
718 | 717 |
719 // eax: destination FixedArray | 718 // eax: destination FixedArray |
720 // ebx: number of elements | 719 // ebx: number of elements |
721 __ mov(FieldOperand(eax, HeapObject::kMapOffset), | 720 __ mov(FieldOperand(eax, HeapObject::kMapOffset), |
722 Immediate(masm->isolate()->factory()->fixed_array_map())); | 721 Immediate(masm->isolate()->factory()->fixed_array_map())); |
723 __ mov(FieldOperand(eax, FixedArray::kLengthOffset), ebx); | 722 __ mov(FieldOperand(eax, FixedArray::kLengthOffset), ebx); |
724 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); | 723 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); |
725 | 724 |
726 // Allocating heap numbers in the loop below can fail and cause a jump to | 725 // Allocating heap numbers in the loop below can fail and cause a jump to |
727 // gc_required. We can't leave a partly initialized FixedArray behind, | 726 // gc_required. We can't leave a partly initialized FixedArray behind, |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 CodePatcher patcher(isolate, sequence, young_length); | 1042 CodePatcher patcher(isolate, sequence, young_length); |
1044 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); | 1043 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); |
1045 } | 1044 } |
1046 } | 1045 } |
1047 | 1046 |
1048 | 1047 |
1049 } // namespace internal | 1048 } // namespace internal |
1050 } // namespace v8 | 1049 } // namespace v8 |
1051 | 1050 |
1052 #endif // V8_TARGET_ARCH_IA32 | 1051 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |