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

Side by Side Diff: test/mjsunit/elements-kind.js

Issue 417953004: Revert 22595: "Keep new arrays allocated with 'new Array(N)' in fast mode" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/mjsunit/array-unshift.js ('k') | test/mjsunit/es7/object-observe.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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 for (var i = 0; i < 1337; i++) { 138 for (var i = 0; i < 1337; i++) {
139 var val = i; 139 var val = i;
140 if (i == 1336) { 140 if (i == 1336) {
141 assertKind(elements_kind.fast_smi_only, you); 141 assertKind(elements_kind.fast_smi_only, you);
142 val = new Object(); 142 val = new Object();
143 } 143 }
144 you[i] = val; 144 you[i] = val;
145 } 145 }
146 assertKind(elements_kind.fast, you); 146 assertKind(elements_kind.fast, you);
147 147
148 var temp = []; 148 assertKind(elements_kind.dictionary, new Array(0xDECAF));
149 temp[0xDECAF] = 0;
150 assertKind(elements_kind.dictionary, temp);
151 149
152 var fast_double_array = new Array(0xDECAF); 150 var fast_double_array = new Array(0xDECAF);
153 for (var i = 0; i < 0xDECAF; i++) fast_double_array[i] = i / 2; 151 for (var i = 0; i < 0xDECAF; i++) fast_double_array[i] = i / 2;
154 assertKind(elements_kind.fast_double, fast_double_array); 152 assertKind(elements_kind.fast_double, fast_double_array);
155 153
156 assertKind(elements_kind.fixed_int8, new Int8Array(007)); 154 assertKind(elements_kind.fixed_int8, new Int8Array(007));
157 assertKind(elements_kind.fixed_uint8, new Uint8Array(007)); 155 assertKind(elements_kind.fixed_uint8, new Uint8Array(007));
158 assertKind(elements_kind.fixed_int16, new Int16Array(666)); 156 assertKind(elements_kind.fixed_int16, new Int16Array(666));
159 assertKind(elements_kind.fixed_uint16, new Uint16Array(42)); 157 assertKind(elements_kind.fixed_uint16, new Uint16Array(42));
160 assertKind(elements_kind.fixed_int32, new Int32Array(0xF)); 158 assertKind(elements_kind.fixed_int32, new Int32Array(0xF));
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 // Test that Array.splice() and Array.slice() return correct ElementsKinds. 375 // Test that Array.splice() and Array.slice() return correct ElementsKinds.
378 var a = ["foo", "bar"]; 376 var a = ["foo", "bar"];
379 assertKind(elements_kind.fast, a); 377 assertKind(elements_kind.fast, a);
380 var b = a.splice(0, 1); 378 var b = a.splice(0, 1);
381 assertKind(elements_kind.fast, b); 379 assertKind(elements_kind.fast, b);
382 var c = a.slice(0, 1); 380 var c = a.slice(0, 1);
383 assertKind(elements_kind.fast, c); 381 assertKind(elements_kind.fast, c);
384 382
385 // Throw away type information in the ICs for next stress run. 383 // Throw away type information in the ICs for next stress run.
386 gc(); 384 gc();
OLDNEW
« no previous file with comments | « test/mjsunit/array-unshift.js ('k') | test/mjsunit/es7/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698