Re:Mozilla, WebKit To Support Debugging CoffeeScript and oth...
by ryanpetrich on Tuesday August 09, 2011 @09:44AM
(#2863964)
V8 does not use "hidden C++ classes." It specializes a memory layout for each object layout and uses tracing to optimize property access into direct offset reads/writes.
Re:Mozilla, WebKit To Support Debugging CoffeeScript and oth...
by Cushman on Tuesday August 09, 2011 @12:43PM
(#2864663)
I'm willing to believe you, but I didn't make that up, I was just cribbing from the link: To reduce the time required to access JavaScript properties, V8 does not use dynamic lookup to access properties. Instead, V8 dynamically creates hidden classes behind the scenes.
I gather a "hidden class" is not an idiom of C++ as I'd assumed, rather something V8 people made up, but that's what they call it.
If you desire some piece of behavior you're used to from hash tables in other languages, you can of course implement that yourself on top of the JS object. Or you could learn to live with abstractions that don't leak.