Last Comment Bug 701973 - Eliminate token munging
: Eliminate token munging
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla11
Assigned To: Jeff Walden [:Waldo] (remove +bmo to email)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-11 19:20 PST by Jeff Walden [:Waldo] (remove +bmo to email)
Modified: 2011-11-29 04:53 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Extract TOK_CONST from TOK_VAR, and make Parser::variables not implicitly depend on the current token (15.94 KB, patch)
2011-11-11 19:20 PST, Jeff Walden [:Waldo] (remove +bmo to email)
jorendorff: review+
Details | Diff | Splinter Review
Make Parser::functionBody callers specify the body kind, rather than inferring it from the current token (5.92 KB, patch)
2011-11-11 19:21 PST, Jeff Walden [:Waldo] (remove +bmo to email)
jorendorff: review+
Details | Diff | Splinter Review

Description Jeff Walden [:Waldo] (remove +bmo to email) 2011-11-11 19:20:11 PST
Created attachment 573985 [details] [diff] [review]
Extract TOK_CONST from TOK_VAR, and make Parser::variables not implicitly depend on the current token

These patches will be atop the ones in bug 701620.
Comment 1 Jeff Walden [:Waldo] (remove +bmo to email) 2011-11-11 19:21:06 PST
Created attachment 573986 [details] [diff] [review]
Make Parser::functionBody callers specify the body kind, rather than inferring it from the current token
Comment 2 Jason Orendorff [:jorendorff] 2011-11-28 10:43:30 PST
Comment on attachment 573985 [details] [diff] [review]
Extract TOK_CONST from TOK_VAR, and make Parser::variables not implicitly depend on the current token

This patch is a beautiful thing. Thanks!

>+        DebugOnly<bool> matched = matchToken(tt);
>+        JS_ASSERT(matched);

This could be
  JS_ALWAYS_TRUE(matchToken(tt));

Your call.
Comment 3 Jason Orendorff [:jorendorff] 2011-11-28 10:53:48 PST
Comment on attachment 573986 [details] [diff] [review]
Make Parser::functionBody callers specify the body kind, rather than inferring it from the current token

Again, nothing but beautiful.

>     /* Mutators. */
>     bool reportCompileErrorNumberVA(ParseNode *pn, uintN flags, uintN errorNumber, va_list ap);
>-    void mungeCurrentToken(TokenKind newKind) { tokens[cursor].type = newKind; }

That comment doesn't make sense anymore, not to say it really made sense before.

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