3 ms·
> V8 uses cons-strings internally Ohhh. I had no idea. That makes the next point a lot more understandable. > '~' as a prefix means non-optimized function. W
by kragen 15y ago
> V8 uses cons-strings internally
Ohhh. I had no idea. That makes the next point a lot more understandable.
> '~' as a prefix means non-optimized function.
Where does ToNumber come from? It sounds like the kind of thing that ought to get optimized!
> Those are functions that force object from fast-mode to dictionary-mode
You mean, if you use delete, getters, setters, seal, or freeze, then the object will use dictionary-mode thereafter under he covers?
> if you "misuse" arguments in a function it will not be optimized).
What constitutes "misuse"? Anything other than .length, [i], and applying a function to it, I guess (e.g. passing it to some other function such as Array.prototype.slice)?
> I have not seen any real world code that suffers from this problem.
So it exists theoretically? The benefit of being implemented this way would be that creating closures is a lot faster and they use less space.
- mraleph 15y ago> Where does ToNumber come from? It sounds like the kind of thing that ought to get optimized! ToNumber comes from Number(l). I can't see how it can be optimized (l is a string so parsing is unavoidable). > You mean, if you use delete, getters, setters, seal, or freeze, then the object will use dictionary-mode thereafter under he covers? Yes. > What constitutes "misuse"? Your understanding of misuse is correct. > So it exists theoretically? Yes.
- kragen 15y agoThank you very much!