Status: Accepted
Owner: [email protected]
Labels: Type-Bug Priority-Medium
New issue 1489 by [email protected]: Unnecessary patching for
megamorphic load-length ICs
http://code.google.com/p/v8/issues/detail?id=1489
For array and string length load ICs we continue patching the call site
even after the IC reached megamorphic state. This makes the runtime call
unnecessarily costlier.
Small repro:
var a = "foo";
var b = [1,2,3];
function f(s) {
for (i = 0; i < s.length; i++) {}
return i;
}
for (var j=0; j<1000000; j++) f(j % 2 ? a : b);
Output with --trace-ic:
[LoadIC : +#length /string]
[LoadIC : +#length /string]
[LoadIC : +#length /string]
[LoadIC : +#length /string]
[LoadIC : +#length /array]
[LoadIC : +#length /array]
[LoadIC : +#length /array]
[LoadIC : +#length /array]
[LoadIC : +#length /string]
[LoadIC : +#length /string]
[LoadIC : +#length /string]
[LoadIC : +#length /string]
etc...
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev