Remove assorted arity-checks that are easily done another way (or not at all)

RESOLVED FIXED in Firefox 41

Status

()

Core
JavaScript Engine
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Waldo, Assigned: Waldo)

Tracking

(Blocks: 1 bug)

unspecified
mozilla41
Points:
---

Firefox Tracking Flags

(firefox41 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Various arity-tests that there's no reason to do, that are either entirely removable *or* should be converted into assertions or whatever.
(Assignee)

Comment 1

3 years ago
Created attachment 8610687 [details] [diff] [review]
Patch

These removals are basically trivial.  Other arity uses will require more thought generally...I think.  But the end of the tunnel is definitely in sight, per acking.

The last FooNode with a test() method that tests arity is ListNode.  I'm not yet sure what I want to do about that -- we sort of still do want list-ful checking for that, or something.  Mega-kind assertion would be a little sad, but maybe I'll have a bright idea when I think on it harder.
Attachment #8610687 - Flags: review?(shu)

Comment 2

3 years ago
Comment on attachment 8610687 [details] [diff] [review]
Patch

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

::: js/src/frontend/NameFunctions.cpp
@@ +336,5 @@
>          RootedAtom prefix(cx, prefixArg);
>          if (cur == nullptr)
>              return true;
>  
> +        MOZ_ASSERT(cur->isKind(PNK_FUNCTION) == cur->isArity(PN_CODE));

Nit: I think it would read clearer to have MOZ_ASSERT(cur->isArity(PN_CODE)) in the if block below this.
Attachment #8610687 - Flags: review?(shu) → review+
https://hg.mozilla.org/mozilla-central/rev/a0781f78620a
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox41: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.