[hazards] Virtual method resolution is incorrect/incomplete
Categories
(Core :: JavaScript: GC, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | affected |
People
(Reporter: sfink, Assigned: sfink)
References
(Depends on 4 open bugs, Blocks 1 open bug)
Details
Attachments
(7 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Fix the search path for virtual method implementations: for example static types that inherit their implementations from a base class will currently think that "sibling" classes' implementations are possible.
Base
| \
| \
Class Sibling
|
|
Subclass
Class *c = ...;
c->foo();
If Base::foo is declared as pure virtual, and Subclass and Sibling both override foo() but Class does not, then the call of c->foo() can only invoke Subclass::foo. Previously, we would see that c->foo() calls Base.foo (because foo is inherited from Base) and do a descendant search starting from Base rather than Class.
In the same situation except where Base::foo is defined (as a virtual method), then c->foo() might call either Subclass::foo() or Base::foo(), but still not Sibling::foo().
This turns out to be important for handling methods that are defined at the base of a large class hierarchy that overrides the implementation in the leaves but not the middle ("interface-y") classes. With this patch, you'll only consider the subtree rooted at your static type. Without, you'll assume it could call any of the implementations in the tree.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D46542
Assignee | ||
Comment 4•5 years ago
|
||
Allows future support for attributes on virtual method declarations.
Also fixes the search path for virtual method implementations: for example static types that inherit their implementations from a base class will currently think that "sibling" classes' implementations are possible.
Base
| \
| \
Class Sibling
|
|
Subclass
Class *c = ...;
c->foo();
If Base::foo is declared as pure virtual, and Subclass and Sibling both override foo() but Class does not, then the call of c->foo() can only invoke Subclass::foo. Previously, we would see that c->foo() calls Base.foo (because foo is inherited from Base) and do a descendant search starting from Base rather than Class.
In the same situation except where Base::foo is defined (as a virtual method), then c->foo() might call either Subclass::foo() or Base::foo(), but still not Sibling::foo().
This turns out to be important for handling methods that are defined at the base of a large class hierarchy that overrides the implementation in the leaves but not the middle ("interface-y") classes. With this patch, you'll only consider the subtree rooted at your static type. Without, you'll assume it could call any of the implementations in the tree.
Depends on D46543
Assignee | ||
Comment 5•5 years ago
|
||
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/42d646d94f82
https://hg.mozilla.org/mozilla-central/rev/a250a3f9b5db
https://hg.mozilla.org/mozilla-central/rev/8c6f9730f77d
Updated•5 years ago
|
Assignee | ||
Comment 9•5 years ago
|
||
Oops, I should have marked this leave-open. The 4th patch still needs to land, and can't. I landed the others because they are refactoring prerequisites for some other bugs to land. But the final patch here is the only one that really matters for this bug.
Updated•5 years ago
|
Comment 10•5 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:sfink, maybe it's time to close this bug?
Assignee | ||
Comment 11•5 years ago
|
||
(In reply to Release mgmt bot [:sylvestre / :calixte / :marco for bugbug] from comment #10)
The leave-open keyword is there and there is no activity for 6 months.
:sfink, maybe it's time to close this bug?
I should probably comment on at least one of these.
The patches are still good, still ready to land, but cannot land until I sort out some issues in Gecko code that block this landing. I'd like to get back to it, but it's lower priority behind some other stuff.
Comment 12•4 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:sfink, maybe it's time to close this bug?
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 13•4 years ago
|
||
Comment 14•4 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:sfink, maybe it's time to close this bug?
Assignee | ||
Comment 15•3 years ago
|
||
Still blocked. Working on the blockage, somewhat.
Assignee | ||
Comment 16•3 years ago
|
||
Assignee | ||
Comment 17•3 years ago
|
||
Comment 18•3 years ago
|
||
Comment 19•3 years ago
|
||
Comment 20•3 years ago
|
||
bugherder |
Assignee | ||
Comment 21•3 years ago
|
||
(removing leave-open)
Description
•