Status
()
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Tracking
(Blocks: 1 bug, {dev-doc-complete})
Bug Flags:
Firefox Tracking Flags
(Not tracked)
Details
Attachments
(4 attachments, 1 obsolete attachment)
10.01 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
3.20 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
6.68 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
6.36 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
This is similar to bug 747289 but promises less. A pure getter promises that calling it has no side-effects (e.g. it doesn't flush and will never run script), but does not promise that the value returned is the same no matter what. So it can be reordered wrt slot sets, but not wrt DOM methods or setters. A preliminary attempt at this for Element.id gives me http://dromaeo.com/?id=189130,189131 because it makes Dromaeo's .id test completely useless.... But I expect this to help in real-life code that touches things like .className too. Now one issue is that _most_ DOM getters are pure, but to be safe-by-default we should probably explicitly mark them so. That means an unfortunate lot of annotation. :(
![]() |
(Assignee) | |
Updated•6 years ago
|
Assignee: nobody → bzbarsky
Whiteboard: [need review]
![]() |
(Assignee) | |
Comment 1•6 years ago
|
||
Created attachment 707154 [details] [diff] [review] part 1. Mark Node.namespaceURI as not throwing, since [Constant] things aren't allowed to throw (though we were not enforcing that).
Attachment #707154 -
Flags: review?(peterv)
![]() |
(Assignee) | |
Comment 2•6 years ago
|
||
Created attachment 707167 [details] [diff] [review] part 2. Implement WebIDL parser and codegen support for marking things pure.
Attachment #707167 -
Flags: review?(peterv)
![]() |
(Assignee) | |
Comment 3•6 years ago
|
||
Created attachment 707171 [details] [diff] [review] part 3. Add the notion of aliasing DOM stuff to MIR and flag MGetDOMProperty with the right alias set if it's pure.
Attachment #707171 -
Flags: review?(jdemooij)
![]() |
(Assignee) | |
Comment 4•6 years ago
|
||
Created attachment 707172 [details] [diff] [review] part 4. Flag a bunch of DOM getters as [Pure].
Attachment #707172 -
Flags: review?(peterv)
![]() |
(Assignee) | |
Comment 5•6 years ago
|
||
Oh, and I'm not doing methods yet because jandem tells me there are complications with trying to move around MCalls. But I really want to sort those out, and then we can do this for a bunch of methods too.
![]() |
(Assignee) | |
Updated•6 years ago
|
Keywords: dev-doc-needed
Comment 6•6 years ago
|
||
Comment on attachment 707171 [details] [diff] [review] part 3. Add the notion of aliasing DOM stuff to MIR and flag MGetDOMProperty with the right alias set if it's pure. Review of attachment 707171 [details] [diff] [review]: ----------------------------------------------------------------- Nice!
Attachment #707171 -
Flags: review?(jdemooij) → review+
![]() |
(Assignee) | |
Comment 7•6 years ago
|
||
Created attachment 707342 [details] [diff] [review] part 1. Mark Node.namespaceURI as not throwing, since [Constant] things aren't allowed to throw (though we were not enforcing that).
Attachment #707342 -
Flags: review?(peterv)
![]() |
(Assignee) | |
Updated•6 years ago
|
Attachment #707154 -
Attachment is obsolete: true
Attachment #707154 -
Flags: review?(peterv)
Updated•6 years ago
|
Attachment #707342 -
Flags: review?(peterv) → review+
Comment 8•6 years ago
|
||
Comment on attachment 707167 [details] [diff] [review] part 2. Implement WebIDL parser and codegen support for marking things pure. Review of attachment 707167 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/Codegen.py @@ +4682,5 @@ > sig = sigs[0] > + if (len(sig[1]) != 0 or > + not infallibleForMember(self.member, sig[0], self.descriptor)): > + # We have arguments or our return-value boxing can fail > + methodInfal = False I think you should just do the |methodInfal = "infallible" in self.descriptor.getExtendedAttributes(self.member)| bit here in an else block.
Attachment #707167 -
Flags: review?(peterv) → review+
Updated•6 years ago
|
Attachment #707172 -
Flags: review?(peterv) → review+
![]() |
(Assignee) | |
Comment 9•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/fce9b4a08399 https://hg.mozilla.org/integration/mozilla-inbound/rev/f0bd3d538233 https://hg.mozilla.org/integration/mozilla-inbound/rev/0a21a1eeda35 https://hg.mozilla.org/integration/mozilla-inbound/rev/d8a95f5b67d7
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla21
![]() |
(Assignee) | |
Comment 10•6 years ago
|
||
Documented at https://developer.mozilla.org/en-US/docs/Mozilla/WebIDL_bindings#.5BPure.5D
Keywords: dev-doc-needed → dev-doc-complete
Comment 11•6 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/fce9b4a08399 https://hg.mozilla.org/mozilla-central/rev/f0bd3d538233 https://hg.mozilla.org/mozilla-central/rev/0a21a1eeda35 https://hg.mozilla.org/mozilla-central/rev/d8a95f5b67d7
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•