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

Side by Side Diff: test/mjsunit/string-index.js

Issue 1028093002: VectorICs: keyed element loads were kicking out non-smi keys unnecessarily (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Turn off --vector-ics flag. Created 5 years, 9 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
« src/mips/code-stubs-mips.cc ('K') | « src/x64/full-codegen-x64.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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 var keys = [0, 10]; 243 var keys = [0, 10];
244 var str = 'ab', arr = ['a', undefined]; 244 var str = 'ab', arr = ['a', undefined];
245 for (var i = 0; i < 100; ++i) { 245 for (var i = 0; i < 100; ++i) {
246 var index = Math.floor(i / 50); 246 var index = Math.floor(i / 50);
247 var key = keys[index]; 247 var key = keys[index];
248 var expected = arr[index]; 248 var expected = arr[index];
249 var actual = str[key]; 249 var actual = str[key];
250 assertEquals(expected, actual); 250 assertEquals(expected, actual);
251 } 251 }
252 252
253 // Test out of range with a heap number case.
254 Math.abs(-343.2);
255 var keys = [0, Math.abs(2)];
Yang 2015/03/23 14:23:59 You probably should check that this is not a smi v
mvstanton 2015/03/23 15:54:45 Done. And the Math.floor(x) * 0.5 trick seems to w
256 var str = 'ab', arr = ['a', undefined];
257 for (var i = 0; i < 100; ++i) {
258 var index = Math.floor(i / 50);
259 var key = keys[index];
260 var expected = arr[index];
261 var actual = str[key];
262 assertEquals(expected, actual);
263 }
264
253 // Test two byte string. 265 // Test two byte string.
254 var str = '\u0427', arr = ['\u0427']; 266 var str = '\u0427', arr = ['\u0427'];
255 for (var i = 0; i < 50; ++i) { 267 for (var i = 0; i < 50; ++i) {
256 var expected = arr[0]; 268 var expected = arr[0];
257 var actual = str[0]; 269 var actual = str[0];
258 assertEquals(expected, actual); 270 assertEquals(expected, actual);
259 } 271 }
OLDNEW
« src/mips/code-stubs-mips.cc ('K') | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698