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

Unified Diff: test/mjsunit/compiler/compare_map_elim.js

Issue 99043002: Check elimination: Learn from if(CompareMap(x)) on true branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update the copy state, not the original. Created 7 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 | « src/hydrogen-check-elimination.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/compare_map_elim.js
diff --git a/test/mjsunit/regress/regress-982.js b/test/mjsunit/compiler/compare_map_elim.js
similarity index 86%
copy from test/mjsunit/regress/regress-982.js
copy to test/mjsunit/compiler/compare_map_elim.js
index d88543a74d430317bf4a75576b48c497962e14af..288d4811a6811691366841f7693495f6c785da9e 100644
--- a/test/mjsunit/regress/regress-982.js
+++ b/test/mjsunit/compiler/compare_map_elim.js
@@ -25,21 +25,27 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-function f(a) {
- return {className: 'xxx'};
-};
+// Flags: --allow-natives-syntax --check-elimination
-var x = 1;
+a = {
+ f: function() { this.y = 3; }
+};
+b = {
+ f: function() { this.y = 4; }
+};
-function g(active) {
- for (i = 1; i <= 20000; i++) {
- if (i == active) {
- x = i;
- if (f("" + i) != null) { }
- } else {
- if (f("" + i) != null) { }
- }
- }
+function x(z) {
+ return z.f();
}
-g(0);
+x(a);
+x(b);
+x(a);
+x(b);
+x(a);
+x(b);
+
+%OptimizeFunctionOnNextCall(x)
+
+x(a);
+x(b);
« no previous file with comments | « src/hydrogen-check-elimination.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698