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

Unified Diff: tests/language/src/OptimizationTest.dart

Issue 9020030: Optimize indexed store for growable array (intrinsification and inlined optimized). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
« no previous file with comments | « runtime/vm/opt_code_generator_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/OptimizationTest.dart
===================================================================
--- tests/language/src/OptimizationTest.dart (revision 2725)
+++ tests/language/src/OptimizationTest.dart (working copy)
@@ -27,6 +27,14 @@
return ~a;
}
+doStore1(a, v) {
+ a[1] = v;
+}
+
+doStore2(a, v) {
+ a[2] = v;
+}
+
main() {
for (int i = 0; i < 2000; i++) {
Expect.stringEquals("HI 5", addThem("HI ", 5));
@@ -62,4 +70,20 @@
}
// Deoptimize.
Expect.equals(-5, doNeg2(5));
+
+ var fixed = new List(10);
+ var growable = [1, 2, 3, 4, 5];
+
+ for (int i = 0; i < 2000; i++) {
+ doStore1(fixed, 7);
+ Expect.equals(7, fixed[1]);
+ doStore2(growable, 12);
+ Expect.equals(12, growable[2]);
+ }
+
+ // Deoptimize.
+ doStore1(growable, 8);
+ Expect.equals(8, growable[1]);
+ doStore2(fixed, 101);
+ Expect.equals(101, fixed[2]);
}
« no previous file with comments | « runtime/vm/opt_code_generator_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698