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: | JavaScriptCore | Assignee: | Keith Miller <keith_miller> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | ||
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Keith Miller
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Keith Miller
*** This bug has been marked as a duplicate of bug 176391 ***