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

Side by Side Diff: src/mips/codegen-mips.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 | « no previous file | src/mips64/codegen-mips64.cc » ('j') | 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_MIPS 7 #if V8_TARGET_ARCH_MIPS
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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 889
890 // Prepare for conversion loop. 890 // Prepare for conversion loop.
891 Register src_elements = elements; 891 Register src_elements = elements;
892 Register dst_elements = target_map; 892 Register dst_elements = target_map;
893 Register dst_end = length; 893 Register dst_end = length;
894 Register heap_number_map = scratch; 894 Register heap_number_map = scratch;
895 __ Addu(src_elements, src_elements, Operand( 895 __ Addu(src_elements, src_elements, Operand(
896 FixedDoubleArray::kHeaderSize - kHeapObjectTag 896 FixedDoubleArray::kHeaderSize - kHeapObjectTag
897 + Register::kExponentOffset)); 897 + Register::kExponentOffset));
898 __ Addu(dst_elements, array, Operand(FixedArray::kHeaderSize)); 898 __ Addu(dst_elements, array, Operand(FixedArray::kHeaderSize));
899 __ Addu(array, array, Operand(kHeapObjectTag));
900 __ sll(dst_end, dst_end, 1); 899 __ sll(dst_end, dst_end, 1);
901 __ Addu(dst_end, dst_elements, dst_end); 900 __ Addu(dst_end, dst_elements, dst_end);
901
902 // Allocating heap numbers in the loop below can fail and cause a jump to
903 // gc_required. We can't leave a partly initialized FixedArray behind,
904 // so pessimistically fill it with holes now.
905 Label initialization_loop, initialization_loop_entry;
906 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
907 __ Branch(&initialization_loop_entry);
908 __ bind(&initialization_loop);
909 __ sw(scratch, MemOperand(dst_elements));
910 __ Addu(dst_elements, dst_elements, Operand(kPointerSize));
911 __ bind(&initialization_loop_entry);
912 __ Branch(&initialization_loop, lt, dst_elements, Operand(dst_end));
913
914 __ Addu(dst_elements, array, Operand(FixedArray::kHeaderSize));
915 __ Addu(array, array, Operand(kHeapObjectTag));
902 __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); 916 __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
903 // Using offsetted addresses. 917 // Using offsetted addresses.
904 // dst_elements: begin of destination FixedArray element fields, not tagged 918 // dst_elements: begin of destination FixedArray element fields, not tagged
905 // src_elements: begin of source FixedDoubleArray element fields, not tagged, 919 // src_elements: begin of source FixedDoubleArray element fields, not tagged,
906 // points to the exponent 920 // points to the exponent
907 // dst_end: end of destination FixedArray, not tagged 921 // dst_end: end of destination FixedArray, not tagged
908 // array: destination FixedArray 922 // array: destination FixedArray
909 // heap_number_map: heap number map 923 // heap_number_map: heap number map
910 __ Branch(&entry); 924 __ Branch(&entry);
911 925
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 patcher.masm()->nop(); // Pad the empty space. 1257 patcher.masm()->nop(); // Pad the empty space.
1244 } 1258 }
1245 } 1259 }
1246 1260
1247 1261
1248 #undef __ 1262 #undef __
1249 1263
1250 } } // namespace v8::internal 1264 } } // namespace v8::internal
1251 1265
1252 #endif // V8_TARGET_ARCH_MIPS 1266 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips64/codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698