[JSC] Add Object.getOwnPropertyNames caching as it is done for Object.keys, and accelerate Object.getOwnPropertyDescriptor
Created attachment 406878 [details] Patch
Created attachment 406881 [details] Patch
Created attachment 406882 [details] Patch
Comment on attachment 406882 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406882&action=review Nice. r=me > Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:944 > + CachedPropertyNames key = node->op() == ObjectGetOwnPropertyNames ? CachedPropertyNames::OwnNames : CachedPropertyNames::OwnKeys; nit: Just put this inline in the function call below? > Source/JavaScriptCore/runtime/StructureRareData.cpp:79 > + auto validateAndAppend = [&](WriteBarrier<JSImmutableButterfly>& slot) { nit: why not just have this in the loop below? > Source/JavaScriptCore/runtime/StructureRareData.h:40 > +enum class CachedPropertyNames : uint8_t { nit: I'd name this "CachedPropertyNamesKind" or similar
Comment on attachment 406882 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406882&action=review Thanks! >> Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:944 >> + CachedPropertyNames key = node->op() == ObjectGetOwnPropertyNames ? CachedPropertyNames::OwnNames : CachedPropertyNames::OwnKeys; > > nit: Just put this inline in the function call below? Sounds nice, fixed. >> Source/JavaScriptCore/runtime/StructureRareData.cpp:79 >> + auto validateAndAppend = [&](WriteBarrier<JSImmutableButterfly>& slot) { > > nit: why not just have this in the loop below? Ah, right. Originally, they are not loop, But I made it loop by refactoring. We should put it inside loop without lambda. Fixed. >> Source/JavaScriptCore/runtime/StructureRareData.h:40 >> +enum class CachedPropertyNames : uint8_t { > > nit: I'd name this "CachedPropertyNamesKind" or similar Fixed.
Created attachment 406899 [details] Patch for landing
Committed r265934: <https://trac.webkit.org/changeset/265934>
<rdar://problem/67452338>