Last Comment Bug 753249 - Remove non-TCF_FUN_FLAGS from TreeContextFlags
: Remove non-TCF_FUN_FLAGS from TreeContextFlags
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla15
Assigned To: Nicholas Nethercote [:njn]
:
Mentors:
Depends on: 752816
Blocks: UntangleFrontEnd 753657
  Show dependency treegraph
 
Reported: 2012-05-08 23:27 PDT by Nicholas Nethercote [:njn]
Modified: 2012-05-15 06:26 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch 1: remove TCF_IN_FUNCTION (38.27 KB, patch)
2012-05-08 23:28 PDT, Nicholas Nethercote [:njn]
luke: review+
Details | Diff | Review
Patch 2: remove TCF_IN_FOR_INIT (23.02 KB, patch)
2012-05-08 23:30 PDT, Nicholas Nethercote [:njn]
luke: review+
Details | Diff | Review
Patch 3: remove TCF_IN_WITH (6.50 KB, patch)
2012-05-08 23:31 PDT, Nicholas Nethercote [:njn]
luke: review+
Details | Diff | Review
Patch 4: remove TCF_HAS_SINGLETONS (6.52 KB, patch)
2012-05-08 23:32 PDT, Nicholas Nethercote [:njn]
luke: review+
Details | Diff | Review
Patch 5: simplify use of TCF_GENEXP_LAMBDA in FoldConstants (6.52 KB, patch)
2012-05-08 23:34 PDT, Nicholas Nethercote [:njn]
luke: review+
Details | Diff | Review
Patch 6: remove TCF_GENEXP_LAMBDA (10.47 KB, patch)
2012-05-08 23:35 PDT, Nicholas Nethercote [:njn]
luke: review+
Details | Diff | Review

Description Nicholas Nethercote [:njn] 2012-05-08 23:27:47 PDT
In this bug I will remove the flags in TreeContextFlags that are not in TCF_FUN_FLAGS.
Comment 1 Nicholas Nethercote [:njn] 2012-05-08 23:28:53 PDT
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.)
Comment 2 Nicholas Nethercote [:njn] 2012-05-08 23:30:16 PDT
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.
Comment 3 Nicholas Nethercote [:njn] 2012-05-08 23:31:40 PDT
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.
Comment 4 Nicholas Nethercote [:njn] 2012-05-08 23:32:45 PDT
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.
Comment 5 Nicholas Nethercote [:njn] 2012-05-08 23:34:05 PDT
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.
Comment 6 Nicholas Nethercote [:njn] 2012-05-08 23:35:23 PDT
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.
Comment 7 Luke Wagner [:luke] 2012-05-09 10:10:23 PDT
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.
Comment 8 Luke Wagner [:luke] 2012-05-09 10:16:11 PDT
Comment on attachment 622297 [details] [diff] [review]
Patch 5: simplify use of TCF_GENEXP_LAMBDA in FoldConstants

mindblowing
Comment 9 Luke Wagner [:luke] 2012-05-09 10:16:57 PDT
Comment on attachment 622299 [details] [diff] [review]
Patch 6: remove TCF_GENEXP_LAMBDA

rock on

Note You need to log in before you can comment on or make changes to this bug.