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

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

Issue 10558005: Further extend TypedArray support in d8: (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Michael's comments. Created 8 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 | « src/objects-inl.h ('k') | test/mjsunit/external-array.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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 assertKind(elements_kind.fast_double, fast_double_array); 136 assertKind(elements_kind.fast_double, fast_double_array);
137 137
138 assertKind(elements_kind.external_byte, new Int8Array(9001)); 138 assertKind(elements_kind.external_byte, new Int8Array(9001));
139 assertKind(elements_kind.external_unsigned_byte, new Uint8Array(007)); 139 assertKind(elements_kind.external_unsigned_byte, new Uint8Array(007));
140 assertKind(elements_kind.external_short, new Int16Array(666)); 140 assertKind(elements_kind.external_short, new Int16Array(666));
141 assertKind(elements_kind.external_unsigned_short, new Uint16Array(42)); 141 assertKind(elements_kind.external_unsigned_short, new Uint16Array(42));
142 assertKind(elements_kind.external_int, new Int32Array(0xF)); 142 assertKind(elements_kind.external_int, new Int32Array(0xF));
143 assertKind(elements_kind.external_unsigned_int, new Uint32Array(23)); 143 assertKind(elements_kind.external_unsigned_int, new Uint32Array(23));
144 assertKind(elements_kind.external_float, new Float32Array(7)); 144 assertKind(elements_kind.external_float, new Float32Array(7));
145 assertKind(elements_kind.external_double, new Float64Array(0)); 145 assertKind(elements_kind.external_double, new Float64Array(0));
146 assertKind(elements_kind.external_pixel, new PixelArray(512)); 146 assertKind(elements_kind.external_pixel, new Uint8ClampedArray(512));
147 147
148 // Crankshaft support for smi-only array elements. 148 // Crankshaft support for smi-only array elements.
149 function monomorphic(array) { 149 function monomorphic(array) {
150 assertKind(elements_kind.fast_smi_only, array); 150 assertKind(elements_kind.fast_smi_only, array);
151 for (var i = 0; i < 3; i++) { 151 for (var i = 0; i < 3; i++) {
152 array[i] = i + 10; 152 array[i] = i + 10;
153 } 153 }
154 assertKind(elements_kind.fast_smi_only, array); 154 assertKind(elements_kind.fast_smi_only, array);
155 for (var i = 0; i < 3; i++) { 155 for (var i = 0; i < 3; i++) {
156 var a = array[i]; 156 var a = array[i];
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 var a = ["foo", "bar"]; 339 var a = ["foo", "bar"];
340 assertKind(elements_kind.fast, a); 340 assertKind(elements_kind.fast, a);
341 var b = a.splice(0, 1); 341 var b = a.splice(0, 1);
342 assertKind(elements_kind.fast, b); 342 assertKind(elements_kind.fast, b);
343 var c = a.slice(0, 1); 343 var c = a.slice(0, 1);
344 assertKind(elements_kind.fast, c); 344 assertKind(elements_kind.fast, c);
345 } 345 }
346 346
347 // Throw away type information in the ICs for next stress run. 347 // Throw away type information in the ICs for next stress run.
348 gc(); 348 gc();
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | test/mjsunit/external-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698