Now, JSGlobalObject is an immutable prototype exotic object. It means that we cannot change the [[Prototype]] of JSGlobalObject. However, our JSC API allows us to change it specially. What do you think of dropping this feature?
Seems OK to me, to match the spec.
Created attachment 321118 [details] Patch
Comment on attachment 321118 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=321118&action=review > Source/JavaScriptCore/ChangeLog:15 > + edge cases. While we do not allow users to change [[Prototype]] of the global object, our JS API has the way to set custom [[Prototype]] of global object by setting "prototype" of JSClassRef. So I think it's ok even in terms of the ability of JSC APIs.
Comment on attachment 321118 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=321118&action=review >> Source/JavaScriptCore/ChangeLog:15 >> + edge cases. > > While we do not allow users to change [[Prototype]] of the global object, our JS API has the way to set custom [[Prototype]] of global object by setting "prototype" of JSClassRef. > So I think it's ok even in terms of the ability of JSC APIs. Can we now constant fold toThis on global object? Why doesn't this patch remove the JSGlobalObject::resetPrototype API?
Comment on attachment 321118 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=321118&action=review >>> Source/JavaScriptCore/ChangeLog:15 >>> + edge cases. >> >> While we do not allow users to change [[Prototype]] of the global object, our JS API has the way to set custom [[Prototype]] of global object by setting "prototype" of JSClassRef. >> So I think it's ok even in terms of the ability of JSC APIs. > > Can we now constant fold toThis on global object? Why doesn't this patch remove the JSGlobalObject::resetPrototype API? Not yet. I'm now removing resetPrototype things to perform constant folding GlobalThis by ensuring that prototype is not changed after instantiation. But resetPrototype still exists in the other places. This patch is a first step to remove it.
Comment on attachment 321118 [details] Patch Thank you for your reviews!
Comment on attachment 321118 [details] Patch Clearing flags on attachment: 321118 Committed r222175: <http://trac.webkit.org/changeset/222175>
All reviewed patches have been landed. Closing bug.
<rdar://problem/34693228>