Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deoptimize try-catch less radically #2918

Merged
merged 3 commits into from Jun 11, 2019

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

After reports that the try-catch optimization may be too radical in some instances, this PR will tone it down further. It also includes dedicated regression tests for es5-shim, es6-shim and core-js.

try-statement-deoptimization will now no longer deoptimize functions called from try-catch-blocks, the exception being parameters called if the function is provided directly as an argument.

funtion test(callback) {
  try {
    // callback is included. Tree-shaking inside callback will only occur if it is directly an argument
    callback();
    // call is included but the body of someOtherFunction may be tree-shaken
    someOtherFunction();
  } catch();
}

// is retained as it is
test(() => Object.create(null));

// call is retained but the body of someOtherFunction may be tree-shaken
test(someOtherFunction);

@lukastaegert
Copy link
Member Author

cc @manucorporat

@lukastaegert lukastaegert merged commit 355c690 into master Jun 11, 2019
@lukastaegert lukastaegert deleted the deopt-try-catch-less-radically branch June 11, 2019 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant