Traditionally, if we find a dictionary in the prototype chain when we're trying to cache, we do a fromDictionary transition, so the cache can succeed. For example, in tryCacheGetById: // Since we're accessing a prototype in a loop, it's a good bet that it // should not be treated as a dictionary. if (slotBaseObject->structure()->isDictionary()) slotBaseObject-
setStructure(Structure::fromDictionaryTransition(slotBaseObject- structure()));
Is there a good reason not to do that in this case? Geoff
It didn't occur to me to try that, especially in the get property names case where we do it first time, without seeing if we hit it multiple times. Maybe it's worth it? but my measurements showed a slight regression in v8 and a slight progression in sunspider so i was given an all clear. Shouldn't be too difficult to test. --Oliver On Jun 23, 2009, at 11:18 PM, Geoffrey Garen wrote:
Traditionally, if we find a dictionary in the prototype chain when we're trying to cache, we do a fromDictionary transition, so the cache can succeed. For example, in tryCacheGetById:
// Since we're accessing a prototype in a loop, it's a good bet that it // should not be treated as a dictionary. if (slotBaseObject->structure()->isDictionary()) slotBaseObject-
setStructure(Structure::fromDictionaryTransition(slotBaseObject- structure()));
Is there a good reason not to do that in this case?
Geoff
On Jun 23, 2009, at 11:24 PM, Oliver Hunt wrote:
It didn't occur to me to try that, especially in the get property names case where we do it first time, without seeing if we hit it multiple times.
Maybe it's worth it? but my measurements showed a slight regression in v8 and a slight progression in sunspider so i was given an all clear.
Shouldn't be too difficult to test.
I think your change was fine as-is but Geoff's idea sounds like a potential further improvement. - Maciej
participants (3)
-
Geoffrey Garen
-
Maciej Stachowiak
-
Oliver Hunt