Mark map-transition stores as map-changing instructions.
authorfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 17 Dec 2010 13:44:19 +0000 (13:44 +0000)
committerfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 17 Dec 2010 13:44:19 +0000 (13:44 +0000)
commit6cc0310a723ece3da5802db2f9ab749a525f0842
tree2eb39e6986ac2a5553dcdecfdea18d27d11ba297
parent06ac3b18a0b9d86a56f2e4584fa184b7bd2fba46
Mark map-transition stores as map-changing instructions.

This prevents code motion from hoisting map-checks across such stores
which may result in unnecessary deoptimizations.

In the following example program we would move a map-check from the inner loop out before the outer loop which is not desirable:

function f() {
  var o = {};
  var j = 0;
  o.a = 1;
  do {
    o.b = 6;  // Map transition
    for (var i=0; i<10; i++) {
       o.a = o.b + i;
    }
  } while(++j < 1) {}
}

for (var i = 0; i < 1000000; i++) f();

Review URL: http://codereview.chromium.org/5991001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6071 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/hydrogen-instructions.cc
src/hydrogen-instructions.h
src/hydrogen.cc