If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Handle 'for' statements in syntax parser

RESOLVED FIXED in mozilla22

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bhackett, Unassigned)

Tracking

Other Branch
mozilla22
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 718490 [details] [diff] [review]
patch

Bug 835587 punted on parsing the syntax for 'for' statements as they are incredibly complicated and currently require lots of digging around in the parse tree (which does not exist during syntax parsing).  The attached patch adds a simplified version for 'for' statements that doesn't deal with 'let', 'for each', complicated 'for in' initializers or destructuring.  This should allow it to handle most any 'for' statement expected to be seen in content.

This also allows the syntax parser to handle 'try' statements, which were being aborted on due to the lexical scope added in catch blocks.

With this change, syntax parsing succeeds on the minified jQuery used in octane-codeload.  The speedup from syntax parsing is 3.8x, the same as was seen with the original hacked up patch in bug 835587.
Attachment #718490 - Flags: review?(jorendorff)
(Reporter)

Updated

5 years ago
Blocks: 678037
Comment on attachment 718490 [details] [diff] [review]
patch

Review of attachment 718490 [details] [diff] [review]:
-----------------------------------------------------------------

Awful lot of code duplication. :-\

I guess it's all right. Certainly everything looks correct.
Attachment #718490 - Flags: review?(jorendorff) → review+
(Reporter)

Comment 2

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/c5a9366bb26c
https://hg.mozilla.org/mozilla-central/rev/c5a9366bb26c
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.