3 ms·
> Okay, but how about other JavaScript engines? SpiderMonkey uses NaN-boxing, so pointers to objects will sometimes take up less space than in V8. As for hidde
by pcwalton 9y ago
> Okay, but how about other JavaScript engines?
SpiderMonkey uses NaN-boxing, so pointers to objects will sometimes take up less space than in V8. As for hidden classes, I'm not sure about how shapes (SpiderMonkey's term for hidden classes) interact with constructors.
> And shouldn't stuff like this be in the specs, so that the language becomes more consistent and predictable?
That would stifle compiler innovation. Not even the "low-level", "predictable" C and C++ mandate particular implementations, beyond specifying the bare minimum necessary to ensure pointer arithmetic works portably.
- amelius 9y ago> Not even the "low-level", "predictable" C and C++ mandate particular implementations But at least with C and C++ a developer can test the performance before deployment.