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

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

Issue 636313003: Fix uninitialized FixedArray potentially being left behind by ElementsTransitionGenerator::Generate… (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/arm/codegen-arm.cc ('k') | src/ia32/codegen-ia32.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/arm64/simulator-arm64.h" 9 #include "src/arm64/simulator-arm64.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 Register map_root = array_size; 283 Register map_root = array_size;
284 __ LoadRoot(map_root, Heap::kFixedArrayMapRootIndex); 284 __ LoadRoot(map_root, Heap::kFixedArrayMapRootIndex);
285 __ SmiTag(x11, length); 285 __ SmiTag(x11, length);
286 __ Str(x11, MemOperand(array, FixedDoubleArray::kLengthOffset)); 286 __ Str(x11, MemOperand(array, FixedDoubleArray::kLengthOffset));
287 __ Str(map_root, MemOperand(array, HeapObject::kMapOffset)); 287 __ Str(map_root, MemOperand(array, HeapObject::kMapOffset));
288 288
289 // Prepare for conversion loop. 289 // Prepare for conversion loop.
290 Register src_elements = x10; 290 Register src_elements = x10;
291 Register dst_elements = x11; 291 Register dst_elements = x11;
292 Register dst_end = x12; 292 Register dst_end = x12;
293 Register the_hole = x14;
294 __ LoadRoot(the_hole, Heap::kTheHoleValueRootIndex);
293 __ Add(src_elements, elements, 295 __ Add(src_elements, elements,
294 FixedDoubleArray::kHeaderSize - kHeapObjectTag); 296 FixedDoubleArray::kHeaderSize - kHeapObjectTag);
295 __ Add(dst_elements, array, FixedArray::kHeaderSize); 297 __ Add(dst_elements, array, FixedArray::kHeaderSize);
296 __ Add(array, array, kHeapObjectTag);
297 __ Add(dst_end, dst_elements, Operand(length, LSL, kPointerSizeLog2)); 298 __ Add(dst_end, dst_elements, Operand(length, LSL, kPointerSizeLog2));
298 299
299 Register the_hole = x14; 300 // Allocating heap numbers in the loop below can fail and cause a jump to
301 // gc_required. We can't leave a partly initialized FixedArray behind,
302 // so pessimistically fill it with holes now.
303 Label initialization_loop, initialization_loop_entry;
304 __ B(&initialization_loop_entry);
305 __ bind(&initialization_loop);
306 __ Str(the_hole, MemOperand(dst_elements, kPointerSize, PostIndex));
307 __ bind(&initialization_loop_entry);
308 __ Cmp(dst_elements, dst_end);
309 __ B(lt, &initialization_loop);
310
311 __ Add(dst_elements, array, FixedArray::kHeaderSize);
312 __ Add(array, array, kHeapObjectTag);
313
300 Register heap_num_map = x15; 314 Register heap_num_map = x15;
301 __ LoadRoot(the_hole, Heap::kTheHoleValueRootIndex);
302 __ LoadRoot(heap_num_map, Heap::kHeapNumberMapRootIndex); 315 __ LoadRoot(heap_num_map, Heap::kHeapNumberMapRootIndex);
303 316
304 Label entry; 317 Label entry;
305 __ B(&entry); 318 __ B(&entry);
306 319
307 // Call into runtime if GC is required. 320 // Call into runtime if GC is required.
308 __ Bind(&gc_required); 321 __ Bind(&gc_required);
309 __ Pop(value, key, receiver, target_map); 322 __ Pop(value, key, receiver, target_map);
310 __ Pop(lr); 323 __ Pop(lr);
311 __ B(fail); 324 __ B(fail);
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 __ Fmul(result, double_temp3, double_temp1); 630 __ Fmul(result, double_temp3, double_temp1);
618 631
619 __ Bind(&done); 632 __ Bind(&done);
620 } 633 }
621 634
622 #undef __ 635 #undef __
623 636
624 } } // namespace v8::internal 637 } } // namespace v8::internal
625 638
626 #endif // V8_TARGET_ARCH_ARM64 639 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698