bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Remove dead code in functionDef

NEW
Unassigned

Status

()

Core
JavaScript Engine
6 years ago
4 years ago

People

(Reporter: ejpbruel, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [js:t])

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Why are we calling fn->pn_cookie.makeFree() on the following line?
http://mxr.mozilla.org/mozilla-central/source/js/src/frontend/Parser.cpp#1507

fn is a placeholder definition stored in the list of lexical dependencies for the current tree context, i.e. we have not yet seen a definition for it. Afaict, upvar cookies are only set during binding, i.e. when we encounter a definition. This would imply that fn->pn_cookie.isFree() is guaranteed to be true.

Adding an assertion JS_ASSERT(fn->pn_cookie.isFree()) and running jit-tests doesn't cause any breakage. Ok to remove this line?
(Reporter)

Comment 1

6 years ago
Created attachment 643008 [details] [diff] [review]
Patch to be reviewed
Attachment #643008 - Flags: review?(n.nethercote)
Comment on attachment 643008 [details] [diff] [review]
Patch to be reviewed

I don't understand upvar cookies and their use enough to be comfortable reviewing this, sorry.

One thing, however:  you should run jstests.py as well as jit-tests;  that will give you a *lot* more test coverage.  Use a command something like this:

  python tests/jstests.py -j 8 $BUILD/js
Attachment #643008 - Flags: review?(n.nethercote)
Whiteboard: [js:t]
(Reporter)

Updated

5 years ago
Assignee: ejpbruel → general
(Assignee)

Updated

4 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.