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

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

Issue 660184: Implemented one-char cache lookup in generated code. (Closed)
Patch Set: Created 10 years, 10 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/x64/codegen-x64.cc ('K') | « test/mjsunit/string-charat.js ('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 2256286eece5e1dc072784b932eac2d909ecc6c4..c6b26a85eea65b22f82bdf742d02e435bb51ccb8 100644
--- a/test/mjsunit/string-index.js
+++ b/test/mjsunit/string-index.js
@@ -152,3 +152,17 @@ assertEquals('o', S2);
var s2 = (s[-2] = 't');
assertEquals('undefined', typeof(s[-2]));
assertEquals('t', s2);
+
+// Make sure enough of the one-char string cache is filled.
+var alpha = ['@'];
+for (var i = 1; i < 128; i++) {
+ var c = String.fromCharCode(i);
+ alpha[i] = c[0];
+}
+var alphaStr = alpha.join("");
+
+// Now test chars.
+for (var i = 1; i < 128; i++) {
+ assertEquals(alpha[i], alphaStr[i]);
+ assertEquals(String.fromCharCode(i), alphaStr[i]);
+}
« src/x64/codegen-x64.cc ('K') | « test/mjsunit/string-charat.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698