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

Add chain invocation for $moduleInit(), $moduleStart(), and $configureInit() methods #42387

Conversation

Thushara-Piyasekara
Copy link
Contributor

@Thushara-Piyasekara Thushara-Piyasekara commented Mar 22, 2024

Purpose

During the codegen phase we generate a set of functions for initializing modules and their ballerina constructs. As of now, these initializations are done using a flattened dependency list for each ballerina module.

Fixes #42367

Approach

Changed the $moduleInit() and $moduleStart() BIRFunction generation boilerplate to generate a invocations of $moduleInit() functions instead of <.init>() functions. The new method generation will be as follows,

image

Did the same change for generated $configureInit() methods inside $configurationMapper class.

Samples

Full change samples can be found in this document.

Previous New

image image
image image
image image
image image

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

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

@Thushara-Piyasekara Thushara-Piyasekara marked this pull request as ready for review March 27, 2024 15:54
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

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

Project coverage is 76.56%. Comparing base (72b015d) to head (65dbc4f).
Report is 196 commits behind head on master.

❗ Current head 65dbc4f differs from pull request most recent head 94ae478. Consider uploading reports for the commit 94ae478 to get more accurate results

Files Patch % Lines
...erinalang/compiler/bir/codegen/JvmCodeGenUtil.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #42387      +/-   ##
============================================
+ Coverage     76.54%   76.56%   +0.02%     
- Complexity    53391    53433      +42     
============================================
  Files          2900     2902       +2     
  Lines        201860   201917      +57     
  Branches      26278    26275       -3     
============================================
+ Hits         154504   154598      +94     
+ Misses        38873    38850      -23     
+ Partials       8483     8469      -14     

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

@Thushara-Piyasekara Thushara-Piyasekara changed the title Add chain invocation for $moduleInit() and $configureInit() methods Add chain invocation for $moduleInit(), $moduleInit(), and $configureInit() methods Mar 28, 2024
@Thushara-Piyasekara Thushara-Piyasekara changed the title Add chain invocation for $moduleInit(), $moduleInit(), and $configureInit() methods Add chain invocation for $moduleInit(), $moduleStart(), and $configureInit() methods Mar 28, 2024
@CLAassistant
Copy link

CLAassistant commented Mar 29, 2024

CLA assistant check
All committers have signed the CLA.

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.

[Improvement]: Change invocation design of $moduleInit() and $configureInit() methods in codegen phase
3 participants