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

[master] Fix file too large due to many record default functions #42671

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

warunalakshitha
Copy link
Contributor

@warunalakshitha warunalakshitha commented Apr 30, 2024

Purpose

Fixes #42655

Approach

This PR will improve the generated to code as below to avoid file too large and method too large issues due to high record default functions.

  1. Move generated record field default functions to generated to functions/$generated$ class
  2. Move split methods to "functions/$generated$" class
  3. Move lambda methods from init class to "lambdas/$generated$" class
  4. Split "lambdas/$generated$" and "functions/$generated$" classes to separate classed depend on functions count
  5. use functions.call() method to execute record default functions in imported modules

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

Copy link

codecov bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 97.84946% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 77.27%. Comparing base (f22f3e8) to head (f5b9151).
Report is 22 commits behind head on master.

Files Patch % Lines
...lang/compiler/bir/codegen/methodgen/LambdaGen.java 96.80% 3 Missing ⚠️
...erinalang/compiler/bir/codegen/JvmCodeGenUtil.java 71.42% 1 Missing and 1 partial ⚠️
...nalang/compiler/bir/codegen/JvmInstructionGen.java 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #42671   +/-   ##
=========================================
  Coverage     77.26%   77.27%           
- Complexity    51301    51315   +14     
=========================================
  Files          2928     2932    +4     
  Lines        204391   204470   +79     
  Branches      26659    26677   +18     
=========================================
+ Hits         157925   158001   +76     
+ Misses        37885    37882    -3     
- Partials       8581     8587    +6     

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

Comment on lines 346 to +350

if (!isSamePkg) {
mv.visitLdcInsn(lambdaDetails.encodedFuncName);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (!isSamePkg) {
mv.visitLdcInsn(lambdaDetails.encodedFuncName);
}
if (!isSamePkg) {
mv.visitLdcInsn(lambdaDetails.encodedFuncName);
}

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.

[Bug]: Hl7v2x libs failed to build with update 9 RC2
2 participants