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

Side by Side Diff: test/mjsunit/fast-prototype.js

Issue 10556004: Revert part of 11727 as it sometimes tanked V8 benchmark (raytrace) performance (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-heap.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
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // Adding this many properties makes it slow. 64 // Adding this many properties makes it slow.
65 assertFalse(%HasFastProperties(proto)); 65 assertFalse(%HasFastProperties(proto));
66 DoProtoMagic(proto, set__proto__); 66 DoProtoMagic(proto, set__proto__);
67 // Making it a prototype makes it fast again. 67 // Making it a prototype makes it fast again.
68 assertTrue(%HasFastProperties(proto)); 68 assertTrue(%HasFastProperties(proto));
69 } else { 69 } else {
70 DoProtoMagic(proto, set__proto__); 70 DoProtoMagic(proto, set__proto__);
71 // Still fast 71 // Still fast
72 assertTrue(%HasFastProperties(proto)); 72 assertTrue(%HasFastProperties(proto));
73 AddProps(proto); 73 AddProps(proto);
74 // Setting the bit means it is still fast with all these properties. 74 // After we add all those properties it went slow mode again :-(
75 assertTrue(%HasFastProperties(proto)); 75 assertFalse(%HasFastProperties(proto));
76 } 76 }
77 if (same_map_as && !add_first) { 77 if (same_map_as && !add_first) {
78 assertTrue(%HaveSameMap(same_map_as, proto)); 78 assertTrue(%HaveSameMap(same_map_as, proto));
79 } 79 }
80 return proto; 80 return proto;
81 } 81 }
82 82
83 83
84 for (var i = 0; i < 4; i++) { 84 for (var i = 0; i < 4; i++) {
85 var set__proto__ = ((i & 1) != 0); 85 var set__proto__ = ((i & 1) != 0);
(...skipping 18 matching lines...) Expand all
104 assertTrue(key == 'a'); 104 assertTrue(key == 'a');
105 break; 105 break;
106 } 106 }
107 assertFalse(%HasFastProperties(x)); 107 assertFalse(%HasFastProperties(x));
108 x.d = 4; 108 x.d = 4;
109 assertFalse(%HasFastProperties(x)); 109 assertFalse(%HasFastProperties(x));
110 for (key in x) { 110 for (key in x) {
111 assertTrue(key == 'a'); 111 assertTrue(key == 'a');
112 break; 112 break;
113 } 113 }
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698