Bug 150983

Summary: We should treat structures that vary solely in their prototype as a single polymorphic type.
Product: WebKit Reporter: Keith Miller <keith_miller>
Component: JavaScriptCoreAssignee: Keith Miller <keith_miller>
Status: RESOLVED DUPLICATE    
Severity: Normal    
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Keith Miller
Reported 2015-11-06 16:12:25 PST
Consider the following code: function foo() function Bar(x) { this.x = x; } return new Bar(1); } Every time foo() is called the returned value will have a different prototype. At some point, probably the second time we construct a new Bar() we should convert the structure into a new one that instead indicates we should get the prototype off the object itself rather than off the structure. This would prevent inline caches from becoming megamorphic.
Attachments
Keith Miller
Comment 1 2017-09-05 14:24:58 PDT
*** This bug has been marked as a duplicate of bug 176391 ***
Note You need to log in before you can comment on or make changes to this bug.