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

Unified Diff: test/mjsunit/field-type-tracking.js

Issue 239923004: Allow merging of monomorphic accesses to tracked fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 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
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/field-type-tracking.js
diff --git a/test/mjsunit/field-type-tracking.js b/test/mjsunit/field-type-tracking.js
index 8da4ed56857378065eaaf1b87108ca470c9ac49d..b4901f34c34e706877316b65242dcfbaf75192d4 100644
--- a/test/mjsunit/field-type-tracking.js
+++ b/test/mjsunit/field-type-tracking.js
@@ -147,3 +147,21 @@
baz(f3, {a: -1});
assertUnoptimized(baz);
})();
+
+(function() {
+ function Foo(x) { this.x = x; this.a = x; }
+ function Bar(x) { this.x = x; this.b = x; }
+ function readA(o) { return o.x.a; }
+ var f = new Foo({a:1});
+ var b = new Bar({a:2});
+ assertEquals(readA(f), 1);
+ assertEquals(readA(b), 2);
+ assertEquals(readA(f), 1);
+ assertEquals(readA(b), 2);
+ %OptimizeFunctionOnNextCall(readA);
+ assertEquals(readA(f), 1);
+ assertEquals(readA(b), 2);
+ assertOptimized(readA);
+ f.a.y = 0;
+ assertUnoptimized(readA);
+})();
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698