Revision: 24508
Author: [email protected]
Date: Fri Oct 10 06:04:31 2014 UTC
Log: X87: Fix uninitialized FixedArray potentially being left behind
by ElementsTransitionGenerator::Generate.
port r24498.
original commit message:
Fix uninitialized FixedArray potentially being left behind by
ElementsTransitionGenerator::Generate.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/643793002
Patch from Chunyang Dai <[email protected]>.
https://code.google.com/p/v8/source/detail?r=24508
Modified:
/branches/bleeding_edge/src/x87/codegen-x87.cc
=======================================
--- /branches/bleeding_edge/src/x87/codegen-x87.cc Sat Sep 20 05:08:58 2014
UTC
+++ /branches/bleeding_edge/src/x87/codegen-x87.cc Fri Oct 10 06:04:31 2014
UTC
@@ -380,6 +380,19 @@
__ mov(FieldOperand(eax, FixedArray::kLengthOffset), ebx);
__ mov(edi, FieldOperand(edx, JSObject::kElementsOffset));
+ // Allocating heap numbers in the loop below can fail and cause a jump to
+ // gc_required. We can't leave a partly initialized FixedArray behind,
+ // so pessimistically fill it with holes now.
+ Label initialization_loop, initialization_loop_entry;
+ __ jmp(&initialization_loop_entry, Label::kNear);
+ __ bind(&initialization_loop);
+ __ mov(FieldOperand(eax, ebx, times_2, FixedArray::kHeaderSize),
+ masm->isolate()->factory()->the_hole_value());
+ __ bind(&initialization_loop_entry);
+ __ sub(ebx, Immediate(Smi::FromInt(1)));
+ __ j(not_sign, &initialization_loop);
+
+ __ mov(ebx, FieldOperand(edi, FixedDoubleArray::kLengthOffset));
__ jmp(&entry);
// ebx: target map
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.