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

Unified Diff: test/mjsunit/omit-constant-mapcheck.js

Issue 131363008: A64: Synchronize with r15922. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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 | « test/mjsunit/mjsunit.status ('k') | test/mjsunit/regress/regress-crbug-258519.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/omit-constant-mapcheck.js
diff --git a/test/mjsunit/regress/regress-polymorphic-store.js b/test/mjsunit/omit-constant-mapcheck.js
similarity index 72%
copy from test/mjsunit/regress/regress-polymorphic-store.js
copy to test/mjsunit/omit-constant-mapcheck.js
index 4723a7f4343bb79daf5283325ee5c1082abefa79..ae6308f215e40ae22b9e9328c5f4e4ec3d0f3843 100644
--- a/test/mjsunit/regress/regress-polymorphic-store.js
+++ b/test/mjsunit/omit-constant-mapcheck.js
@@ -27,22 +27,44 @@
// Flags: --allow-natives-syntax
-var o1 = {};
-o1.f1 = function() { return 10; };
-o1.x = 5;
-o1.y = 2;
-var o2 = {};
-o2.x = 5;
-o2.y = 5;
-
-function store(o, v) {
- o.y = v;
+var g1 = { a:1 }
+
+function load() {
+ return g1.a;
+}
+
+assertEquals(1, load());
+assertEquals(1, load());
+%OptimizeFunctionOnNextCall(load);
+assertEquals(1, load());
+delete g1.a;
+assertEquals(undefined, load());
+
+var g2 = { a:2 }
+
+function load2() {
+ return g2.a;
+}
+
+assertEquals(2, load2());
+assertEquals(2, load2());
+%OptimizeFunctionOnNextCall(load2);
+assertEquals(2, load2());
+g2.b = 10;
+g2.a = 5;
+assertEquals(5, load2());
+
+var g3 = { a:2, b:9, c:1 }
+
+function store(v) {
+ g3.a = v;
+ return g3.a;
}
-store(o2, 0);
-store(o1, 0);
-store(o2, 0);
+assertEquals(5, store(5));
+assertEquals(8, store(8));
%OptimizeFunctionOnNextCall(store);
-store(o1, 10);
-assertEquals(5, o1.x);
-assertEquals(10, o1.y);
+assertEquals(10, store(10));
+delete g3.c;
+store(7);
+assertEquals({a:7, b:9}, g3);
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | test/mjsunit/regress/regress-crbug-258519.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698