We can probably make this fast just by using the setPrototypeOfInline paradigm where we will often be able to inline this call as JSObject::setPrototypeWithCycleCheck. This is needed for Proxy
Created attachment 272677 [details] perf results looks neutral
Created attachment 272678 [details] patch
landed in: http://trac.webkit.org/changeset/197467
Comment on attachment 272678 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=272678&action=review > Source/JavaScriptCore/runtime/ClassInfo.h:113 > + typedef bool (*SetPrototypeOfFunctionPtr)(JSObject*, ExecState*, JSValue); > + SetPrototypeOfFunctionPtr setPrototypeOf; When referring to the object constructor, the spec says "setPrototypeOf" because the object constructor sets the prototype *of* another object. But when we refer to an object setting its own prototype, that should be called "setPrototype". This applies to lots of places in this patch. > Source/JavaScriptCore/runtime/JSObject.h:122 > + ALWAYS_INLINE bool setPrototypeOfInline(VM& vm, ExecState* exec, JSValue prototype) Why do we have this inline variant? I think you should remove it.
(In reply to comment #4) > Comment on attachment 272678 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=272678&action=review > > > Source/JavaScriptCore/runtime/ClassInfo.h:113 > > + typedef bool (*SetPrototypeOfFunctionPtr)(JSObject*, ExecState*, JSValue); > > + SetPrototypeOfFunctionPtr setPrototypeOf; > > When referring to the object constructor, the spec says "setPrototypeOf" > because the object constructor sets the prototype *of* another object. > > But when we refer to an object setting its own prototype, that should be > called "setPrototype". This applies to lots of places in this patch. > > > Source/JavaScriptCore/runtime/JSObject.h:122 > > + ALWAYS_INLINE bool setPrototypeOfInline(VM& vm, ExecState* exec, JSValue prototype) > > Why do we have this inline variant? I think you should remove it. Follow up to your comment in: http://trac.webkit.org/changeset/197484