Skip to content

Revert "feat: improve function return value tracking (#6065)" - #6490

Merged
lukastaegert merged 1 commit into
masterfrom
revert-6065
Aug 28, 2026
Merged

Revert "feat: improve function return value tracking (#6065)"#6490
lukastaegert merged 1 commit into
masterfrom
revert-6065

Conversation

@lukastaegert

Copy link
Copy Markdown
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

Considering the unknown nature of #6488 and #6487, this reverts #6065 for now until the issue is better understood.

Copilot AI lite review requested due to automatic review settings August 28, 2026 04:37
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rollup Ready Ready Preview Aug 28, 2026 4:37am

Request Review

@lukastaegert

Copy link
Copy Markdown
Member Author

cc @cyyynthia

@github-actions

Copy link
Copy Markdown

Performance report

  • BUILD: 7186ms, 831 MB
    • initialize: 0ms, 24 MB
    • generate module graph: 2761ms, 625 MB
      • generate ast: 1414ms, 617 MB
    • sort and bind modules: 406ms, 683 MB
    • mark included statements: 4017ms, 831 MB
      • treeshaking pass 1: 2364ms, 820 MB
      • treeshaking pass 2: 471ms, 829 MB
      • treeshaking pass 3: 402ms, 828 MB
      • treeshaking pass 4: 386ms, 825 MB
      • treeshaking pass 5: 384ms, 831 MB
  • GENERATE: 630ms, 876 MB
    • initialize render: 0ms, 831 MB
    • generate chunks: 41ms, 829 MB
      • optimize chunks: 0ms, 843 MB
    • render chunks: 576ms, 858 MB
    • transform chunks: 13ms, 876 MB
    • generate bundle: 0ms, 876 MB

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#revert-6065

Notice: Ensure you have installed the latest nightly Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust.

or load it into the REPL:
https://rollup-ey2mdnkcs-rollup-js.vercel.app/repl/?pr=6490

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR reverts the changes introduced by #6065 (“improve function return value tracking”) to mitigate suspected regressions in Rollup 4.63.0 related to tree-shaking behavior and performance (issues #6488, #6487).

Changes:

  • Removes/reverts return-value/literal-tracking logic (e.g., MultiExpression behavior and implicit/unknown return handling) to reduce aggressive optimization decisions.
  • Deletes the test fixtures that were added specifically to validate the reverted behavior.
  • Refactors internal “unassigned” sentinels to local symbols and adjusts several AST node implementations accordingly.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/form/samples/pure-comment-scenarios-complex/main.js Updates PURE comment scenario sample to match reverted behavior.
test/form/samples/pure-comment-scenarios-complex/_expected.js Updates expected output for PURE comment scenario after revert.
test/form/samples/object-expression/proto-property/main.js Simplifies proto-property sample (removes extra getter/use cases) to match reverted semantics.
test/form/samples/object-expression/proto-property/_expected.js Updates expected output for proto-property sample.
test/form/samples/literals-from-return-expressions-perf/main.js Removes perf-focused return-expression tracking fixture (revert cleanup).
test/form/samples/literals-from-return-expressions-perf/_expected.js Removes expected output for deleted perf fixture.
test/form/samples/literals-from-return-expressions-perf/_config.js Removes config for deleted perf fixture.
test/form/samples/literals-from-return-expressions-deopt/main.js Removes deopt-focused return-expression tracking fixture (revert cleanup).
test/form/samples/literals-from-return-expressions-deopt/_expected.js Removes expected output for deleted deopt fixture.
test/form/samples/literals-from-return-expressions-deopt/_config.js Removes config for deleted deopt fixture.
test/form/samples/literals-from-return-expressions-branches/main.js Removes branches-focused return-expression tracking fixture (revert cleanup).
test/form/samples/literals-from-return-expressions-branches/_expected.js Removes expected output for deleted branches fixture.
test/form/samples/literals-from-return-expressions-branches/_config.js Removes config for deleted branches fixture.
src/utils/unassigned.ts Removes shared UNASSIGNED sentinel module.
src/ast/values.ts Reworks UNDEFINED_EXPRESSION and member-description defaults as part of the revert.
src/ast/scopes/ReturnValueScope.ts Reverts multi-return handling to avoid MultiExpression aggregation and forces deopts when multiple return paths exist.
src/ast/nodes/UnaryExpression.ts Switches to a local UNASSIGNED sentinel symbol after removing src/utils/unassigned.ts.
src/ast/nodes/shared/ObjectEntity.ts Removes comment references to deleted return-expression tracking fixtures.
src/ast/nodes/shared/MultiExpression.ts Reverts MultiExpression to a simpler propagation model (no literal merging / treeshaken awareness).
src/ast/nodes/shared/Expression.ts Removes LiteralExpression and adjusts UNKNOWN_EXPRESSION representation.
src/ast/nodes/shared/CallExpressionBase.ts Adjusts call-expression cache deopt behavior (but currently introduces a runtime bug).
src/ast/nodes/ReturnStatement.ts Removes return-statement deoptimization tracking and uses doNotDeoptimize hook.
src/ast/nodes/MemberExpression.ts Minor include-path adjustment for optional variable handling.
src/ast/nodes/Literal.ts Adjusts members field mutability typing.
src/ast/nodes/IfStatement.ts Replaces shared UNASSIGNED sentinel usage with local symbol + unknown caching behavior.
src/ast/nodes/CallExpression.ts Replaces prototype include override with an explicit includeNode implementation.
src/ast/nodes/BlockStatement.ts Removes “virtual return statement” construction; directly records an unknown return in scope.
src/ast/nodes/BinaryExpression.ts Switches to a local UNASSIGNED sentinel symbol after removing src/utils/unassigned.ts.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ast/nodes/shared/CallExpressionBase.ts
@lukastaegert
lukastaegert merged commit bdbd0a5 into master Aug 28, 2026
46 checks passed
@lukastaegert
lukastaegert deleted the revert-6065 branch August 28, 2026 04:46
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.78%. Comparing base (db15922) to head (dcf8bb9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6490      +/-   ##
==========================================
+ Coverage   98.76%   98.78%   +0.01%     
==========================================
  Files         276      275       -1     
  Lines       10885    10823      -62     
  Branches     2908     2887      -21     
==========================================
- Hits        10751    10691      -60     
+ Misses         91       89       -2     
  Partials       43       43              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

lukastaegert added a commit that referenced this pull request Aug 28, 2026
@github-actions

Copy link
Copy Markdown

This PR has been released as part of rollup@4.63.1. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants