Closed Bug 845404 Opened 11 years ago Closed 11 years ago

Handle 'for' statements in syntax parser

Categories

(Core :: JavaScript Engine, defect)

Other Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: bhackett1024, Unassigned)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
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)
Blocks: LazyBytecode
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+
https://hg.mozilla.org/mozilla-central/rev/c5a9366bb26c
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: