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

Unified Diff: test/mjsunit/keyed-ic.js

Issue 92008: Small changes to improve test coverage in codegen-ia32.cc. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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/codegen-ia32.cc ('K') | « test/mjsunit/constant-folding.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/keyed-ic.js
===================================================================
--- test/mjsunit/keyed-ic.js (revision 1760)
+++ test/mjsunit/keyed-ic.js (working copy)
@@ -145,6 +145,35 @@
// ----------------------------------------------------------------------
+// Indexed access.
+// ----------------------------------------------------------------------
+runTest = function() {
+ var o = [ 42, 43 ];
+
+ var initial_X = 0;
+ var X = initial_X;
+ var Y = 1;
+
+ function fieldTest(change_index) {
+ for (var i = 0; i < 10; i++) {
+ var property = o[X];
+ if (i <= change_index) {
+ assertEquals(42, property);
+ } else {
+ assertEquals(43, property);
+ }
+ if (i == change_index) X = Y;
+ }
+ X = initial_X;
+ };
+
+ for (var i = 0; i < 10; i++) fieldTest(i);
+}
+
+runTest();
+
+
+// ----------------------------------------------------------------------
// Constant function access.
// ----------------------------------------------------------------------
runTest = function() {
« src/codegen-ia32.cc ('K') | « test/mjsunit/constant-folding.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698