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

Side by Side Diff: test/mjsunit/compiler/load-elimination.js

Issue 151333003: Load elimination fix: load should not be replaced with another load if the former is not dominated … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-load-elimination.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 function C() { 38 function C() {
39 } 39 }
40 40
41 function test_load() { 41 function test_load() {
42 var a = new B(1, 2); 42 var a = new B(1, 2);
43 return a.x + a.x + a.x + a.x; 43 return a.x + a.x + a.x + a.x;
44 } 44 }
45 45
46
47 function test_load_from_different_contexts() {
48 var r = 1;
49 this.f = function() {
50 var fr = r;
51 this.g = function(flag) {
52 var gr;
53 if (flag) {
54 gr = r;
55 } else {
56 gr = r;
57 }
58 return gr + r + fr;
59 };
60 };
61 this.f();
62 return this.g(true);
63 }
64
65
46 function test_store_load() { 66 function test_store_load() {
47 var a = new B(1, 2); 67 var a = new B(1, 2);
48 a.x = 4; 68 a.x = 4;
49 var f = a.x; 69 var f = a.x;
50 a.x = 5; 70 a.x = 5;
51 var g = a.x; 71 var g = a.x;
52 a.x = 6; 72 a.x = 6;
53 var h = a.x; 73 var h = a.x;
54 a.x = 7; 74 a.x = 7;
55 return f + g + h + a.x; 75 return f + g + h + a.x;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 141 }
122 142
123 function test(x, f) { 143 function test(x, f) {
124 assertEquals(x, f()); 144 assertEquals(x, f());
125 assertEquals(x, f()); 145 assertEquals(x, f());
126 %OptimizeFunctionOnNextCall(f); 146 %OptimizeFunctionOnNextCall(f);
127 assertEquals(x, f()); 147 assertEquals(x, f());
128 } 148 }
129 149
130 test(4, test_load); 150 test(4, test_load);
151 test(3, new test_load_from_different_contexts().g);
131 test(22, test_store_load); 152 test(22, test_store_load);
132 test(8, test_nonaliasing_store1); 153 test(8, test_nonaliasing_store1);
133 test(5, test_transitioning_store1); 154 test(5, test_transitioning_store1);
134 test(4, test_transitioning_store2); 155 test(4, test_transitioning_store2);
135 test(20, test_transitioning_store3); 156 test(20, test_transitioning_store3);
136 test(22, test_store_load_kill); 157 test(22, test_store_load_kill);
137 test(7, test_store_store); 158 test(7, test_store_store);
OLDNEW
« no previous file with comments | « src/hydrogen-load-elimination.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698