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

Side by Side Diff: test/mjsunit/dictionary-properties.js

Issue 2036493006: Keep prototype maps in dictionary mode until ICs see them (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: make ignition tests happy Created 4 years, 6 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
« no previous file with comments | « src/string-stream.cc ('k') | test/mjsunit/fast-prototype.js » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 // Flags: --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 6
7 // Test loading existent and nonexistent properties from dictionary 7 // Test loading existent and nonexistent properties from dictionary
8 // mode objects. 8 // mode objects.
9 9
10 function SlowObject() { 10 function SlowObject() {
(...skipping 21 matching lines...) Expand all
32 } 32 }
33 33
34 // Test objects getting optimized as fast prototypes. 34 // Test objects getting optimized as fast prototypes.
35 35
36 function SlowPrototype() { 36 function SlowPrototype() {
37 this.foo = 1; 37 this.foo = 1;
38 } 38 }
39 SlowPrototype.prototype.bar = 2; 39 SlowPrototype.prototype.bar = 2;
40 SlowPrototype.prototype.baz = 3; 40 SlowPrototype.prototype.baz = 3;
41 delete SlowPrototype.prototype.baz; 41 delete SlowPrototype.prototype.baz;
42 new SlowPrototype; 42 assertFalse(%HasFastProperties(SlowPrototype.prototype));
43 var slow_proto = new SlowPrototype;
44 // ICs make prototypes fast.
45 function ic() { return slow_proto.bar; }
46 ic();
47 ic();
48 assertTrue(%HasFastProperties(slow_proto.__proto__));
43 49
44 // Prototypes stay fast even after deleting properties. 50 // Prototypes stay fast even after deleting properties.
45 assertTrue(%HasFastProperties(SlowPrototype.prototype)); 51 assertTrue(%HasFastProperties(SlowPrototype.prototype));
46 var fast_proto = new SlowPrototype(); 52 var fast_proto = new SlowPrototype();
47 assertTrue(%HasFastProperties(SlowPrototype.prototype)); 53 assertTrue(%HasFastProperties(SlowPrototype.prototype));
48 assertTrue(%HasFastProperties(fast_proto.__proto__)); 54 assertTrue(%HasFastProperties(fast_proto.__proto__));
OLDNEW
« no previous file with comments | « src/string-stream.cc ('k') | test/mjsunit/fast-prototype.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698