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

Unified Diff: test/mjsunit/compiler/load-elimination.js

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 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
« no previous file with comments | « test/mjsunit/compiler/escape-analysis-arguments.js ('k') | test/mjsunit/compiler/regress-arguments.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/load-elimination.js
diff --git a/test/mjsunit/compiler/load-elimination.js b/test/mjsunit/compiler/load-elimination.js
index 9475d4b3f6a0007c60415d67ff415c738e9e73a3..9bf8564308218e05973accbe1015a00eb46eae5d 100644
--- a/test/mjsunit/compiler/load-elimination.js
+++ b/test/mjsunit/compiler/load-elimination.js
@@ -43,6 +43,26 @@ function test_load() {
return a.x + a.x + a.x + a.x;
}
+
+function test_load_from_different_contexts() {
+ var r = 1;
+ this.f = function() {
+ var fr = r;
+ this.g = function(flag) {
+ var gr;
+ if (flag) {
+ gr = r;
+ } else {
+ gr = r;
+ }
+ return gr + r + fr;
+ };
+ };
+ this.f();
+ return this.g(true);
+}
+
+
function test_store_load() {
var a = new B(1, 2);
a.x = 4;
@@ -83,6 +103,15 @@ function test_transitioning_store2() {
return a.x + a.y;
}
+var false_v = false;
+function test_transitioning_store3() {
+ var o = new C();
+ var v = o;
+ if (false_v) v = 0;
+ v.x = 20;
+ return o.x;
+}
+
function killall() {
try { } catch(e) { }
}
@@ -119,9 +148,11 @@ function test(x, f) {
}
test(4, test_load);
+test(3, new test_load_from_different_contexts().g);
test(22, test_store_load);
test(8, test_nonaliasing_store1);
test(5, test_transitioning_store1);
test(4, test_transitioning_store2);
+test(20, test_transitioning_store3);
test(22, test_store_load_kill);
test(7, test_store_store);
« no previous file with comments | « test/mjsunit/compiler/escape-analysis-arguments.js ('k') | test/mjsunit/compiler/regress-arguments.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698