Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Don't generate redundant calls to query captured scopes #1734

Closed
wants to merge 1 commit into from

Conversation

NTillmann
Copy link
Contributor

Release notes: None

Don't generate redundant calls of the form
var __captured__scope_2 = __scope_0[0] || __scope_1(0);

Adding regression test.

This addresses one of the observations of #1732.
Also deleted unneeded left-over code and comment that used to refer #989.

Release notes: None

Don't generate redundant calls of the form
`var __captured__scope_2 = __scope_0[0] || __scope_1(0);`

Adding regression test.

This addresses one of the observations of #1732.
Also deleted unneeded left-over code and comment that used to refer #989.
@@ -0,0 +1,16 @@
// add at runtime:var a = 17;
// Copies of \|\|:2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expected this to 1 copy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's two. The closure is accessed from the optimized function, and the inspect function. But not more!

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NTillmann is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

trueadm pushed a commit to trueadm/prepack that referenced this pull request Apr 13, 2018
Summary:
Release notes: None

Don't generate redundant calls of the form
`var __captured__scope_2 = __scope_0[0] || __scope_1(0);`

Adding regression test.

This addresses one of the observations of facebookarchive#1732.
Also deleted unneeded left-over code and comment that used to refer facebookarchive#989.
Closes facebookarchive#1734

Differential Revision: D7602949

Pulled By: NTillmann

fbshipit-source-id: 77d926b236a903eb7927a1471411e8397a0d192a
@hermanventer hermanventer deleted the ModifiedBindingsCapturedScopesCalls branch April 20, 2018 21:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants