Remove non-TCF_FUN_FLAGS from TreeContextFlags

RESOLVED FIXED in mozilla15

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla15
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(6 attachments)

(Assignee)

Description

5 years ago
In this bug I will remove the flags in TreeContextFlags that are not in TCF_FUN_FLAGS.
(Assignee)

Comment 1

5 years ago
Created attachment 622293 [details] [diff] [review]
Patch 1: remove TCF_IN_FUNCTION

TCF_IN_FUNCTION is pretty easy.  It can be replaced by
SharedContext::inFunction.

(BTW, Luke, if you get sick of reviewing these patches let me know and I'll find someone else to do them.)
Attachment #622293 - Flags: review?(luke)
(Assignee)

Comment 2

5 years ago
Created attachment 622294 [details] [diff] [review]
Patch 2: remove TCF_IN_FOR_INIT

TCF_IN_FOR_INIT is similarly easy.  There are a couple of places in
Parser.cpp where it is cleared and then restored and that involved
|oldflags|;  I suspect |oldflags| isn't necessary but I'm not sure so I've
modified that code in a very conservative way, and follow-up patches will
clarify things.
Attachment #622294 - Flags: review?(luke)
(Assignee)

Comment 3

5 years ago
Created attachment 622295 [details] [diff] [review]
Patch 3: remove TCF_IN_WITH

TCF_IN_WITH is easy.  It's *never* set in SharedContext::flags;  it's only
set in FunctionBox::tcflags.  So I made it a separate bit-field in
FunctionBox.
Attachment #622295 - Flags: review?(luke)
(Assignee)

Comment 4

5 years ago
Created attachment 622296 [details] [diff] [review]
Patch 4: remove TCF_HAS_SINGLETONS

TCF_HAS_SINGLETONS is easy to move to a bit-field in BytecodeEmitter.
Attachment #622296 - Flags: review?(luke)
(Assignee)

Comment 5

5 years ago
Created attachment 622297 [details] [diff] [review]
Patch 5: simplify use of TCF_GENEXP_LAMBDA in FoldConstants

This is a precursor to removing TCF_GENEXP_LAMBDA.

TCF_GENEXP_LAMBDA is a funbox->tcflags-only flag, with one exception in
FoldConstants.  But if you look closely, the parser->tc->sc->flags use in
FoldConstants is really weird -- the PN_FUNC case in FoldConstants
temporarily overwrites the existing parser->tc->sc->flags with
pn->pn_funbox->tcflags, so that is what is really being checked!

So this patch stops that silliness, and instead just passes a boolean
around.  Also, FoldConstants did some weird saving/restoring with
functionList;  this is a no-op because nowhere else in FoldConstants.cpp
touches functionList, so I removed it too.
Attachment #622297 - Flags: review?(luke)
(Assignee)

Comment 6

5 years ago
Created attachment 622299 [details] [diff] [review]
Patch 6: remove TCF_GENEXP_LAMBDA

Thanks to the previous patch, TCF_GENEXP_LAMBDA is now only needed in
FunctionBox.  This patch converts it to a bit-field.
Attachment #622299 - Flags: review?(luke)

Updated

5 years ago
Attachment #622293 - Flags: review?(luke) → review+

Comment 7

5 years ago
Comment on attachment 622294 [details] [diff] [review]
Patch 2: remove TCF_IN_FOR_INIT

Awesome; this will make it 10x easier to watch the flow of these bits.
Attachment #622294 - Flags: review?(luke) → review+

Updated

5 years ago
Attachment #622295 - Flags: review?(luke) → review+

Updated

5 years ago
Attachment #622296 - Flags: review?(luke) → review+

Comment 8

5 years ago
Comment on attachment 622297 [details] [diff] [review]
Patch 5: simplify use of TCF_GENEXP_LAMBDA in FoldConstants

mindblowing
Attachment #622297 - Flags: review?(luke) → review+

Comment 9

5 years ago
Comment on attachment 622299 [details] [diff] [review]
Patch 6: remove TCF_GENEXP_LAMBDA

rock on
Attachment #622299 - Flags: review?(luke) → review+
(Assignee)

Updated

5 years ago
Blocks: 753657
(Assignee)

Comment 10

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/9ef220baee5e
https://hg.mozilla.org/integration/mozilla-inbound/rev/3f8e5a401ea0
https://hg.mozilla.org/integration/mozilla-inbound/rev/8fdcdc40cb85
https://hg.mozilla.org/integration/mozilla-inbound/rev/56df36472731
https://hg.mozilla.org/integration/mozilla-inbound/rev/6beadc18515b
https://hg.mozilla.org/integration/mozilla-inbound/rev/b69d000b726a
https://hg.mozilla.org/mozilla-central/rev/9ef220baee5e
https://hg.mozilla.org/mozilla-central/rev/3f8e5a401ea0
https://hg.mozilla.org/mozilla-central/rev/8fdcdc40cb85
https://hg.mozilla.org/mozilla-central/rev/56df36472731
https://hg.mozilla.org/mozilla-central/rev/6beadc18515b
https://hg.mozilla.org/mozilla-central/rev/b69d000b726a
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.