-
Notifications
You must be signed in to change notification settings - Fork 762
[Master] Generate new typedesc instruction for record and tuple when type descriptor resolving #43596
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
base: master
Are you sure you want to change the base?
Conversation
…ors" This reverts commit 962d8f9.
…onstructors"" This reverts commit d470345.
Add closures before the dependent node in the top-level node list in `ClosureGenerator.java`
Exclude field generation for typedesc when generating fields for user defined types since those fields will be generated when visiting global variables
Add typedesc statement before the var declaration in the init function body
|
4b7e401
to
d06359f
Compare
@@ -120,6 +120,12 @@ jobs: | |||
done | |||
shell: bash | |||
|
|||
# - name: Checkout non-default branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets keep this commented since we frequently need this to be enabled
@@ -0,0 +1,227 @@ | |||
================ Emitting Module ================ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is the assert file for TypeDescBIRTest
tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/bir/TypeDescBIRTest.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/wso2/ballerinalang/compiler/bir/codegen/optimizer/LargeMethodOptimizer.java
Outdated
Show resolved
Hide resolved
compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/BIRGen.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor suggestions
compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/BIRGen.java
Show resolved
Hide resolved
...rc/main/java/org/wso2/ballerinalang/compiler/bir/codegen/optimizer/LargeMethodOptimizer.java
Outdated
Show resolved
Hide resolved
compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/Desugar.java
Outdated
Show resolved
Hide resolved
compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/Desugar.java
Outdated
Show resolved
Hide resolved
Address review suggestions and do type constraint equality check to identity the typedesc in different packages
compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/BIRGen.java
Show resolved
Hide resolved
|
Purpose
In this PR, I have generated a new 'typedesc' (type descriptor) only once for the tuple and record.
For example:
We have desugared the above program as follows:
We then use the generated 'typedesc' when creating a map value using that type.
Fixes #38844, #41946, #43311, #43715, #43741