Closed Bug 938355 Opened 11 years ago Closed 11 years ago

Allow marking throwing things as [Pure] in WebIDL

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

(Keywords: dev-doc-complete)

Attachments

(2 files)

We've been conflating two different things under [Pure] to some extent: movability and the alias set.

Things that can throw are not movable, but they can still be side-effect-less.

Per IRC discussion with Eric just now, I'm going to split up the concepts of movability and side-effects in jitinfo.  Then we can make [Pure, Throws] in WebIDL mean no side-effects but not movable.  This will allow us to hoist other movable things past that DOM access, which we can't do right now.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Note: this still never marks method calls movable for now.  We'll worry about it once the JIT can in fact move them.
Whiteboard: [need review]
Comment on attachment 831851 [details] [diff] [review]
part 1.  Refactor jitinfo to separate out the concepts of side-effects and movability.

Review of attachment 831851 [details] [diff] [review]:
-----------------------------------------------------------------

Not only does this allow more progress forward, it also clarifies the existing state a lot. Well done. r=me.

::: dom/bindings/Codegen.py
@@ +6061,3 @@
>          """
> +        aliasSet is a JSJitInfo::AliasSet value, without the "JSJitInfo::" bit.
> +        

nit: trailing whitespace on empty line.
Attachment #831851 - Flags: review?(efaustbmo) → review+
> nit: trailing whitespace on empty line.

Fixed.
Blocks: 942631
Comment on attachment 831852 [details] [diff] [review]
part 2.  Relax the restriction on [Pure] not mixing with [Throws] and annotate some more things as [Pure].

Review of attachment 831852 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me.

::: dom/bindings/Codegen.py
@@ +6064,5 @@
>          argTypes is None if we don't want to output argTypes for some
>          reason (e.g. we have overloads or we're not a method) and
>          otherwise an iterable of the arguments for this method.
>          """
> +        assert(not movable or aliasSet != "AliasEverything") # Can't move write-liasing things

write-*a*liasing
Attachment #831852 - Flags: review?(peterv) → review+
Fixed that typo, and:

   https://hg.mozilla.org/integration/mozilla-inbound/rev/1b65b71cce74
   https://hg.mozilla.org/integration/mozilla-inbound/rev/c4dc627b7880
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla28
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: