Object.freeze has a fast implementation in JSObject, but this hasn't been updated to take into account numeric properties in butterflies. For now, just fall back to the generic implementation if the object has numeric properties.
Created attachment 165530 [details] Fix
Comment on attachment 165530 [details] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=165530&action=review > Source/JavaScriptCore/runtime/ObjectConstructor.cpp:407 > + if (isJSFinalObject(object) && !object->getVectorLength()) { What if the object has gone into sparse mode? Then vector length will be zero even though there are indexed properties. I think what you wanted is: hasIndexedProperties(object->structure()->indexingType())
Created attachment 165533 [details] v2 You're right – added a 2nd test case that covers this.
Fixed in r129461