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

Side by Side Diff: test/mjsunit/regress/regress-666046.js

Issue 2539493002: [heap] Clear recorded slots for inobject properties when migrating fast object to slow mode. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « src/objects.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
(Empty)
1 // 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: --allow-natives-syntax --expose-gc
6
7 function P() {
8 this.a0 = {};
9 this.a1 = {};
10 this.a2 = {};
11 this.a3 = {};
12 this.a4 = {};
13 }
14
15 function A() {
16 }
17
18 var proto = new P();
19 A.prototype = proto;
20
21 function foo(o) {
22 return o.a0;
23 }
24
25 // Ensure |proto| is in old space.
26 gc();
27 gc();
28 gc();
29
30 // Ensure |proto| is marked as "should be fast".
31 var o = new A();
32 foo(o);
33 foo(o);
34 foo(o);
35 assertTrue(%HasFastProperties(proto));
36
37 // Contruct a double value that looks like a tagged pointer.
38 var buffer = new ArrayBuffer(8);
39 var int32view = new Int32Array(buffer);
40 var float64view = new Float64Array(buffer);
41 int32view[0] = int32view[1] = 0x40000001;
42 var boom = float64view[0];
43
44
45 // Write new space object.
46 proto.a4 = {a: 0};
47 // Immediately delete the field.
48 delete proto.a4;
49
50 // |proto| must sill be fast.
51 assertTrue(%HasFastProperties(proto));
52
53 // Add a double field instead of deleted a4 that looks like a tagged pointer.
54 proto.boom = boom;
55
56 // Boom!
57 gc();
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698