Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/mips64/codegen-mips64.cc

Issue 645633002: MIPS: Fix uninitialized FixedArray potentially being left behind by ElementsTransitionGenerator::Ge… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/codegen-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 __ sd(scratch, MemOperand(array, HeapObject::kMapOffset)); 779 __ sd(scratch, MemOperand(array, HeapObject::kMapOffset));
780 780
781 // Prepare for conversion loop. 781 // Prepare for conversion loop.
782 Register src_elements = elements; 782 Register src_elements = elements;
783 Register dst_elements = target_map; 783 Register dst_elements = target_map;
784 Register dst_end = length; 784 Register dst_end = length;
785 Register heap_number_map = scratch; 785 Register heap_number_map = scratch;
786 __ Daddu(src_elements, src_elements, 786 __ Daddu(src_elements, src_elements,
787 Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag + 4)); 787 Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag + 4));
788 __ Daddu(dst_elements, array, Operand(FixedArray::kHeaderSize)); 788 __ Daddu(dst_elements, array, Operand(FixedArray::kHeaderSize));
789 __ Daddu(array, array, Operand(kHeapObjectTag));
790 __ SmiScale(dst_end, dst_end, kPointerSizeLog2); 789 __ SmiScale(dst_end, dst_end, kPointerSizeLog2);
791 __ Daddu(dst_end, dst_elements, dst_end); 790 __ Daddu(dst_end, dst_elements, dst_end);
791
792 // Allocating heap numbers in the loop below can fail and cause a jump to
793 // gc_required. We can't leave a partly initialized FixedArray behind,
794 // so pessimistically fill it with holes now.
795 Label initialization_loop, initialization_loop_entry;
796 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
797 __ Branch(&initialization_loop_entry);
798 __ bind(&initialization_loop);
799 __ sd(scratch, MemOperand(dst_elements));
800 __ Daddu(dst_elements, dst_elements, Operand(kPointerSize));
801 __ bind(&initialization_loop_entry);
802 __ Branch(&initialization_loop, lt, dst_elements, Operand(dst_end));
803
804 __ Daddu(dst_elements, array, Operand(FixedArray::kHeaderSize));
805 __ Daddu(array, array, Operand(kHeapObjectTag));
792 __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); 806 __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
793 // Using offsetted addresses. 807 // Using offsetted addresses.
794 // dst_elements: begin of destination FixedArray element fields, not tagged 808 // dst_elements: begin of destination FixedArray element fields, not tagged
795 // src_elements: begin of source FixedDoubleArray element fields, not tagged, 809 // src_elements: begin of source FixedDoubleArray element fields, not tagged,
796 // points to the exponent 810 // points to the exponent
797 // dst_end: end of destination FixedArray, not tagged 811 // dst_end: end of destination FixedArray, not tagged
798 // array: destination FixedArray 812 // array: destination FixedArray
799 // heap_number_map: heap number map 813 // heap_number_map: heap number map
800 __ Branch(&entry); 814 __ Branch(&entry);
801 815
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 patcher.masm()->nop(); // Pad the empty space. 1147 patcher.masm()->nop(); // Pad the empty space.
1134 } 1148 }
1135 } 1149 }
1136 1150
1137 1151
1138 #undef __ 1152 #undef __
1139 1153
1140 } } // namespace v8::internal 1154 } } // namespace v8::internal
1141 1155
1142 #endif // V8_TARGET_ARCH_MIPS64 1156 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698