blob: 9dc6052c43fc236804299f2401968bd5d992b925 [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Flags: --expose-gc --min-semi-space-size=32
6
7// We need to set --min-semi-space-size to enable allocation site pretenuring.
8
9function foo(i) {
10 with({}) {};
11 x = {};
12 x.a = 0.23;
13 x.b = 0.3;
14 return x;
15}
16
17var all = [];
18function step() {
19 for (var i = 0; i < 100; i++) {
20 var z = foo(i);
21 // Write unboxed double in object slack.
22 z.c = 0.1 + z.b
23 all.push(z);
24 }
25 gc(1);
26 gc(1);
27}
28
29step();
30// Now foo will allocate objects in old space.
31step();