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

Side by Side Diff: test/mjsunit/array-constructor-feedback.js

Issue 23441080: Correct large packed array length limitation (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: make consistent change Created 7 years, 3 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 | « test/mjsunit/allocation-site-info.js ('k') | test/mjsunit/array-feedback.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 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 a = bar(10); 147 a = bar(10);
148 a[0] = "a string"; 148 a[0] = "a string";
149 a = bar(10); 149 a = bar(10);
150 assertKind(elements_kind.fast, a); 150 assertKind(elements_kind.fast, a);
151 %OptimizeFunctionOnNextCall(bar); 151 %OptimizeFunctionOnNextCall(bar);
152 a = bar(10); 152 a = bar(10);
153 assertKind(elements_kind.fast, a); 153 assertKind(elements_kind.fast, a);
154 assertOptimized(bar); 154 assertOptimized(bar);
155 // The stub bails out, but the method call should be fine. 155 // The stub bails out, but the method call should be fine.
156 a = bar(100000); 156 a = bar(100001);
157 assertOptimized(bar); 157 assertOptimized(bar);
158 assertKind(elements_kind.dictionary, a); 158 assertKind(elements_kind.dictionary, a);
159 159
160 // If the argument isn't a smi, it bails out as well 160 // If the argument isn't a smi, it bails out as well
161 a = bar("oops"); 161 a = bar("oops");
162 assertOptimized(bar); 162 assertOptimized(bar);
163 assertKind(elements_kind.fast, a); 163 assertKind(elements_kind.fast, a);
164 164
165 function barn(one, two, three) { 165 function barn(one, two, three) {
166 return new Array(one, two, three); 166 return new Array(one, two, three);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 var contextB = Realm.create(); 214 var contextB = Realm.create();
215 Realm.eval(contextB, "function bar2() { return new Array(); };"); 215 Realm.eval(contextB, "function bar2() { return new Array(); };");
216 Realm.eval(contextB, "bar2(); bar2();"); 216 Realm.eval(contextB, "bar2(); bar2();");
217 Realm.eval(contextB, "%OptimizeFunctionOnNextCall(bar2);"); 217 Realm.eval(contextB, "%OptimizeFunctionOnNextCall(bar2);");
218 Realm.eval(contextB, "bar2();"); 218 Realm.eval(contextB, "bar2();");
219 assertFalse(Realm.eval(contextB, "bar2();") instanceof Array); 219 assertFalse(Realm.eval(contextB, "bar2();") instanceof Array);
220 assertTrue(Realm.eval(contextB, "bar2() instanceof Array")); 220 assertTrue(Realm.eval(contextB, "bar2() instanceof Array"));
221 })(); 221 })();
222 } 222 }
OLDNEW
« no previous file with comments | « test/mjsunit/allocation-site-info.js ('k') | test/mjsunit/array-feedback.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698