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

Unified Diff: test/mjsunit/string-index.js

Issue 1582041: Reapply: Inline fast cases in string keyed load IC. (Closed)
Patch Set: . Created 10 years, 8 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/ia32/ic-ia32.cc ('K') | « src/ia32/ic-ia32.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 3ad71e06ba02164c2d7264ff92b6e45dfa4bf0a2..6f11a5bb93ae5d36617de77d3a39dc0d7478245c 100644
--- a/test/mjsunit/string-index.js
+++ b/test/mjsunit/string-index.js
@@ -35,6 +35,14 @@ assertEquals("F", foo[0]);
assertEquals("o", foo[1]);
assertEquals("o", foo[2]);
+// Test string keyed load IC.
+for (var i = 0; i < 10; i++) {
+ assertEquals("F", foo[0]);
+ assertEquals("o", foo[1]);
+ assertEquals("o", foo[2]);
+ assertEquals("F", (foo[0] + "BarBazQuuxFooBarQuux")[0]);
+}
+
assertEquals("F", foo["0" + ""], "string index");
assertEquals("o", foo["1"], "string index");
assertEquals("o", foo["2"], "string index");
@@ -178,9 +186,9 @@ for (var i = 0; i < 200; ++i) {
assertEquals(expected, actual);
}
-var keys = [0, '1', 2, 3.0];
-var str = 'abcd', arr = ['a', 'b', 'c', 'd'];
-for (var i = 0; i < 200; ++i) {
+var keys = [0, '1', 2, 3.0, -1, 10];
+var str = 'abcd', arr = ['a', 'b', 'c', 'd', undefined, undefined];
+for (var i = 0; i < 300; ++i) {
var index = Math.floor(i / 50);
var key = keys[index];
var expected = arr[index];
« src/ia32/ic-ia32.cc ('K') | « src/ia32/ic-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698