Preserve constant function transition when adding the same function.
authorvitalyr@chromium.org <vitalyr@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 12 Aug 2010 14:51:59 +0000 (14:51 +0000)
committervitalyr@chromium.org <vitalyr@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 12 Aug 2010 14:51:59 +0000 (14:51 +0000)
commit421db370d9b53dca7f20eb8e98a957f97756b08b
tree270646429949282910f9970259f4bfe147472976
parent5cd4a9b78d14b489ee182f0102f7602c1288bb9d
Preserve constant function transition when adding the same function.

This should help in cases like:
function Constructor() {
  this.foo = constFunction;
  this.bar = "baz";
}

for (...) {
  o = new Constructor();
  // Constant call IC will work.
  o.foo();
  // Inlined property load will see the same map.
  use(o.bar);
}

This change also fixes a latent bug in custom call IC-s for strings
exposed by string-charcodeat.js.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5254 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/ia32/stub-cache-ia32.cc
src/mark-compact.cc
src/objects-inl.h
src/objects.cc
src/objects.h
src/property.h