Closed Bug 737570 Opened 12 years ago Closed 12 years ago

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

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: luke, Unassigned)

References

Details

Attachments

(1 file)

Attached patch fix and testSplinter Review
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)
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+
Righto.  noteLocalOverwritesArguments work for you?
Seems to work.
https://hg.mozilla.org/mozilla-central/rev/31d88c5a7b18
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: