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

Unified 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 side-by-side diff with in-line comments
Download patch
« src/mips/code-stubs-mips.cc ('K') | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/string-index.js
diff --git a/test/mjsunit/string-index.js b/test/mjsunit/string-index.js
index 315708ca5fb5e864c7350b3c36a40120de02dad7..eb6ccc688b9109ab1cfb750d10731acab170d163 100644
--- a/test/mjsunit/string-index.js
+++ b/test/mjsunit/string-index.js
@@ -250,6 +250,18 @@ for (var i = 0; i < 100; ++i) {
assertEquals(expected, actual);
}
+// Test out of range with a heap number case.
+Math.abs(-343.2);
+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
+var str = 'ab', arr = ['a', undefined];
+for (var i = 0; i < 100; ++i) {
+ var index = Math.floor(i / 50);
+ var key = keys[index];
+ var expected = arr[index];
+ var actual = str[key];
+ assertEquals(expected, actual);
+}
+
// Test two byte string.
var str = '\u0427', arr = ['\u0427'];
for (var i = 0; i < 50; ++i) {
« 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