ignore overwritten arguments via (non-toplevel) function statement named 'arguments'

RESOLVED FIXED in mozilla14

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: luke, Unassigned)

Tracking

unspecified
mozilla14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 607652 [details] [diff] [review]
fix and test

Broken by bug 724790.  Somehow no tests for this.  The full logic for deoptimizing functions containing non-toplevel function statements is, incredibly, split into 3 places.  This patch collects them in one place and explains the special case in Parser::statements().
Attachment #607652 - Flags: review?(jwalden+bmo)
(Reporter)

Comment 1

5 years ago
Green on try.
Comment on attachment 607652 [details] [diff] [review]
fix and test

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

::: js/src/frontend/Parser.cpp
@@ +1656,5 @@
>              outertc->noteMightAliasLocals();
> +            outertc->noteHasExtensibleScope();
> +            outertc->flags |= TCF_FUN_HEAVYWEIGHT;
> +            if (fun->atom == context->runtime->atomState.argumentsAtom)
> +                outertc->flags |= TCF_FUN_LOCAL_ARGUMENTS;

Do we have a well-named helper for adding this bit?  If not, we probably should add one, so that the exact meaning and method of representation of the bit need not be remembered by the reader.
Attachment #607652 - Flags: review?(jwalden+bmo) → review+
(Reporter)

Comment 3

5 years ago
Righto.  noteLocalOverwritesArguments work for you?
Seems to work.
(Reporter)

Comment 5

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/31d88c5a7b18
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/31d88c5a7b18
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.