Status: New
Owner: ----
Labels: Type-Bug Priority-Low
New issue 1916 by [email protected]: Overwriting native functions with
themselves prevents inlining in crankshaft
http://code.google.com/p/v8/issues/detail?id=1916
Follow-up to crbug.com/67772
Mootools currently does this in order to wrap native objects in a way to
make native functions enumerable:
https://github.com/mootools/mootools-core/issues/2251
Test case:
var string = "1234567890";
var start = new Date().getTime();
for (var i = 0; i < 1000000; i++) string.charAt(2);
var end = new Date().getTime();
print(end - start + "ms");
var proto = String.prototype["charAt"];
delete String.prototype["charAt"];
String.prototype["charAt"] = proto;
start = new Date().getTime();
for (var i = 0; i < 1000000; i++) string.charAt(2);
end = new Date().getTime();
print(end - start + "ms");
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev