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

Sync 2201.11.x with 2201.11.0-stage #43753

Open
wants to merge 1,076 commits into
base: 2201.11.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1076 commits
Select commit Hold shift + click to select a range
c2d39dd
Refactor MappingAtomicType
heshanpadmasiri Jun 20, 2024
3ff74ed
Fix cyclic typing issue
heshanpadmasiri Jun 20, 2024
dd1ba1c
Switch to non sparse array to represent SubTypeData
heshanpadmasiri Jun 22, 2024
367872c
Refact: introduce explicit empty class for TypeCheckCache
heshanpadmasiri Jun 24, 2024
0a9a0db
Implement function semtype
heshanpadmasiri Jul 17, 2024
fce02be
Implement object semtype
heshanpadmasiri Jul 23, 2024
3620471
Fix record shape
heshanpadmasiri Jul 28, 2024
2eb02e7
Implement error semtype
heshanpadmasiri Jul 29, 2024
4c80881
Fix unit tests
heshanpadmasiri Aug 2, 2024
97e4d3d
Add workaround to value converter
heshanpadmasiri Aug 5, 2024
74f2712
Use lazy containers to xml types in Builder
heshanpadmasiri Aug 4, 2024
f64b89f
Use lazy suppliers for PredefinedEnv
heshanpadmasiri Aug 4, 2024
8946917
Rename Lazy containers to lazy suppliers
heshanpadmasiri Aug 4, 2024
d142606
Simplify context supplying
heshanpadmasiri Aug 4, 2024
05f32c3
More lazy initialization in predefined env
heshanpadmasiri Aug 4, 2024
72e1045
Get rid of unwanted private methods and rearrange the code
heshanpadmasiri Aug 4, 2024
4472698
Impmlement handle semtype
heshanpadmasiri Aug 6, 2024
e4b7950
Cleanup BSemTypeWrapper
heshanpadmasiri Aug 6, 2024
a992aa7
Re-ennable type check cache
heshanpadmasiri Aug 6, 2024
1cda781
Encapsulate access to all and some
heshanpadmasiri Aug 6, 2024
cdee3ba
Refactor the semtype class hierachy
heshanpadmasiri Aug 6, 2024
c8e1f0e
Move immutable semtype class to internals
heshanpadmasiri Aug 6, 2024
87eb849
Make BTypes proper semtypes
heshanpadmasiri Aug 7, 2024
92143f9
Patch unit tests with clashing type names
heshanpadmasiri Aug 7, 2024
04c1224
Implement future semtype
heshanpadmasiri Aug 7, 2024
fdff0b9
Implement regex type
heshanpadmasiri Aug 7, 2024
15bc7ac
Implement typedesc semtype
heshanpadmasiri Aug 9, 2024
8449519
Implement table and stream types
heshanpadmasiri Aug 9, 2024
ede9857
Remove fallback type checker from type checking
heshanpadmasiri Aug 13, 2024
df7f942
Implement isSimpleBasicType with SemTypes
heshanpadmasiri Aug 13, 2024
e7e7886
Implement isReferenceEqual with semtypes
heshanpadmasiri Aug 13, 2024
cfeef03
Re ennable type result caching
heshanpadmasiri Aug 13, 2024
5679b6b
Implement value conversion
heshanpadmasiri Aug 13, 2024
40930d6
Remove fallback type checker
heshanpadmasiri Aug 13, 2024
78192d0
Make semtype part of the top type
heshanpadmasiri Aug 13, 2024
bbfbd9a
Refactor isSameType
heshanpadmasiri Aug 13, 2024
b19271d
Optimize convertible type for int subtypes
heshanpadmasiri Aug 14, 2024
b83f54a
Introduce SimpleBdd
heshanpadmasiri Aug 14, 2024
cacca7b
Move MutableSemTypeDependencyManager to internal
heshanpadmasiri Aug 14, 2024
35e1941
Make any and readonly types immutable semtypes
heshanpadmasiri Aug 14, 2024
49fe835
Lazy initialize inner BTypes
heshanpadmasiri Aug 14, 2024
e67c217
Cache cell atom creation
heshanpadmasiri Aug 14, 2024
9a22113
Optimize mapping subtype check
heshanpadmasiri Aug 15, 2024
b9379ad
Use semtypes for valuesEquals
heshanpadmasiri Aug 15, 2024
fed5b55
Use semtypes for casting
heshanpadmasiri Aug 15, 2024
a027250
Refact shapeOf to support inlining
heshanpadmasiri Aug 15, 2024
3a47c04
Refactor memoSubtypeIsEmpty to make it inline
heshanpadmasiri Aug 15, 2024
ada2ffc
Fix thread safty issue in createSemType
heshanpadmasiri Aug 15, 2024
f1dc339
Cache BType results as well
heshanpadmasiri Aug 15, 2024
bb380cd
Only hold weak references in the mutable semtype dependency manager
heshanpadmasiri Aug 15, 2024
7c563ed
Make all context memo tables weak hash maps
heshanpadmasiri Aug 16, 2024
433bb04
Make atom table hold only weak references
heshanpadmasiri Aug 16, 2024
a6e9f47
Cache repeated semtype creation
heshanpadmasiri Aug 16, 2024
9075316
Introduce simplified cell subtype
heshanpadmasiri Aug 18, 2024
039d82e
Avoid caching cell semtypes for complex types
heshanpadmasiri Aug 18, 2024
4557342
Avoid unnecessarily checking for shape
heshanpadmasiri Aug 18, 2024
e97c00e
Cache type check results for user defined types
heshanpadmasiri Aug 18, 2024
5891223
Cache runtime type creation
heshanpadmasiri Aug 18, 2024
6669713
Remove unwanted caching logic
heshanpadmasiri Aug 18, 2024
38b1470
Cleanup access to context
heshanpadmasiri Aug 18, 2024
94f5a74
Refactor anydata type creation
heshanpadmasiri Aug 18, 2024
82e4b34
Use a simple weak map for dependency manager
heshanpadmasiri Aug 19, 2024
a8a4d08
Introduce copy of write BMapType
heshanpadmasiri Aug 19, 2024
10ad23b
Simplify getType
heshanpadmasiri Aug 19, 2024
b06ec83
Remove unwanted optimizations
heshanpadmasiri Aug 19, 2024
61017f9
Fix result caching for futures
heshanpadmasiri Aug 19, 2024
972e724
Fix Union type not getting reset correctly
heshanpadmasiri Aug 19, 2024
a96f7bf
Reduce the overhead for calculating couldShapeBeDifferent
heshanpadmasiri Aug 20, 2024
33da1ac
Be lazy about calculating the flags of tuple types
heshanpadmasiri Aug 20, 2024
fe4382d
Be lazy when creating the semtype result cache
heshanpadmasiri Aug 20, 2024
7e52a7b
Get rid of the stream when filtering nulls
heshanpadmasiri Aug 20, 2024
648ae20
Use concurrent lazy suppliers for BSemTypeWrappers
heshanpadmasiri Aug 21, 2024
097bbb8
Reduce contention in dependency manager
heshanpadmasiri Aug 21, 2024
8747624
Fix runtime semtype resolver
heshanpadmasiri Aug 23, 2024
c7868fa
Fix BFunction Equal
heshanpadmasiri Aug 23, 2024
21d5d6c
Add workarounds to make libraries compile
heshanpadmasiri Aug 23, 2024
c9a5ed4
Better caching of the type creator
heshanpadmasiri Aug 25, 2024
ad1bd59
Make shape calculation thread safe
heshanpadmasiri Aug 25, 2024
a22ba53
Add workaround to handle cyclic shapes
heshanpadmasiri Aug 25, 2024
1859892
Add default implementations to make TestUtils work
heshanpadmasiri Aug 25, 2024
32d4d24
Fix type casts in Intersection type
heshanpadmasiri Aug 25, 2024
dbc26d2
Fix error equals
heshanpadmasiri Aug 25, 2024
f220fbb
Add workaround to make SQL work
heshanpadmasiri Aug 26, 2024
5c542c4
Patch runtime resolver to handle dependtly typed func
heshanpadmasiri Aug 26, 2024
2a98e5a
Fix runtime test errors
heshanpadmasiri Aug 26, 2024
3e8dcdc
Change synchronization of atom table
heshanpadmasiri Aug 28, 2024
3456d8d
Remove BasicTypeBitSet
heshanpadmasiri Aug 31, 2024
19cf208
Restructure semtype structure
heshanpadmasiri Aug 31, 2024
09ede0b
Make tag directly accesible
heshanpadmasiri Sep 1, 2024
7c3aefc
Avoid creating BType when trying to calculate hash and equal for wrapper
heshanpadmasiri Sep 1, 2024
b166f5c
Use result caching with all semtypes
heshanpadmasiri Sep 1, 2024
a058102
Add fast path to hasFillerValue
heshanpadmasiri Sep 2, 2024
03dc027
Refactor workarounds to isSubType
heshanpadmasiri Sep 2, 2024
7da4d8f
Remove MutableSemTypeDependencyManager
heshanpadmasiri Sep 2, 2024
67ac35b
Get rid of BType basic type
heshanpadmasiri Sep 3, 2024
827d22b
Refactor shape anlayzer
heshanpadmasiri Sep 3, 2024
4829592
Avoid creating the inner BType with BSemTypeWrapper when possible
heshanpadmasiri Sep 3, 2024
1752ebc
Fix failing windows errors
heshanpadmasiri Sep 3, 2024
c6efe8d
Fix string shape calculation
heshanpadmasiri Sep 4, 2024
6bea345
Avoid result caching for basic types
heshanpadmasiri Sep 4, 2024
262bfda
Avoid unnecessarily calculating inherent type
heshanpadmasiri Sep 4, 2024
95c4b0f
Avoid unnecessarily creating singleton types
heshanpadmasiri Sep 6, 2024
75e4bcc
Refactor atoms
heshanpadmasiri Sep 8, 2024
db0cc8b
Refactor shape calculation
heshanpadmasiri Sep 6, 2024
3c8b6a6
Get rid of unwanted sychronizations
heshanpadmasiri Sep 8, 2024
c4066b7
Move BddMemo to inner
heshanpadmasiri Sep 11, 2024
093542a
Use accepted type for is likeShape
heshanpadmasiri Sep 15, 2024
58ed6d9
Introduce wrapper for bddEvery
heshanpadmasiri Sep 18, 2024
329c349
Move mutable semtype to inner
heshanpadmasiri Sep 18, 2024
32a95a3
Refactor method names
heshanpadmasiri Sep 29, 2024
8aa8128
Use holder classes to avoid initialization costs in TypeChecker
heshanpadmasiri Sep 29, 2024
aa9fc15
Fix invalid accepted type for union and tables
heshanpadmasiri Oct 1, 2024
d60e067
Refactor type check caching
heshanpadmasiri Oct 3, 2024
c85ccb4
Make cache sharable between type descriptors
heshanpadmasiri Oct 4, 2024
fcede96
Avoid necessary caching in TypeCreator
heshanpadmasiri Oct 4, 2024
54223f5
Avoid duplicate record type creation
heshanpadmasiri Oct 6, 2024
054cd60
Fix narrow type getting cached invalidly
heshanpadmasiri Oct 8, 2024
411e485
Fix tests with duplicate type definitions
heshanpadmasiri Oct 9, 2024
33487c5
Fix comments and naming
heshanpadmasiri Oct 11, 2024
3846215
Fix Dependently typed functions
heshanpadmasiri Oct 13, 2024
04293c3
Fix caching of annon types
heshanpadmasiri Nov 9, 2024
0d36359
Avoid unnecessary locking
heshanpadmasiri Nov 10, 2024
4d22d01
Refactor synchronization logic
heshanpadmasiri Nov 10, 2024
c53f877
Fix future equals
heshanpadmasiri Nov 10, 2024
95367ac
Avoid caching for anon types
heshanpadmasiri Nov 10, 2024
8d1aeca
Use DefinitionContainer to maintain concurrentcy invariants
heshanpadmasiri Nov 11, 2024
016da7e
Fix checkstyle violations
heshanpadmasiri Nov 19, 2024
0ca2edc
Merge pull request #43279 from heshanpadmasiri/feat/runtime-stream
lochana-chathura Nov 20, 2024
7e00058
Update test resources
NipunaRanasinghe Nov 20, 2024
1386283
Add test cases
NipunaRanasinghe Nov 20, 2024
e006755
Fix formatting and checkstyle
NipunaRanasinghe Nov 20, 2024
3a9a0de
Increase the timeout value
gimantha Nov 20, 2024
ec8cf5b
Merge branch 'master' into nutcracker
gimantha Nov 20, 2024
25415e4
Address review suggestions
NipunaRanasinghe Nov 20, 2024
3701963
Bump bir version
lochana-chathura Nov 21, 2024
78fe460
Fix merging issue for LangLibRecordTest class
lochana-chathura Nov 21, 2024
2e71207
Merge pull request #43545 from HindujaB/fix-record-field-master
gimantha Nov 21, 2024
43e6737
Merge pull request #43624 from NipunaRanasinghe/master
NipunaRanasinghe Nov 21, 2024
4330bae
Disable debugger test
HindujaB Nov 21, 2024
58727e7
Merge pull request #43637 from HindujaB/disable-debugger-test
warunalakshitha Nov 21, 2024
58fe102
Merge pull request #43558 from NipunaMadhushan/set-span-status
gimantha Nov 22, 2024
7a51dad
Increase server log reading rate
lochana-chathura Nov 22, 2024
1e2ad86
Fix checkStyle failure
lochana-chathura Nov 22, 2024
b9bd73d
Merge pull request #43594 from ballerina-platform/flow_model
dulajdilshan Nov 22, 2024
4e3496c
Merge branch 'master' of https://github.com/ballerina-platform/baller…
gimantha Nov 22, 2024
e049457
Make process local to method
gimantha Nov 22, 2024
1b89090
Fix import order
gimantha Nov 24, 2024
e79f6e8
Increase server reading rate further
lochana-chathura Nov 24, 2024
4a86052
Increment the wait time
gimantha Nov 25, 2024
5299c50
Merge branch 'nutcracker' of https://github.com/ballerina-platform/ba…
gimantha Nov 25, 2024
2ecf8a2
Increment the wait time
gimantha Nov 25, 2024
d2827d0
Disable integration tests temporarily
gimantha Nov 26, 2024
f765e2f
Revert the sleep time
gimantha Nov 26, 2024
72eb483
Revert using threads
gimantha Nov 27, 2024
45094df
Revert "Revert using threads"
gimantha Nov 28, 2024
d239379
Change arrays to maps for keeping the grouping keys in query expressions
gimantha Nov 28, 2024
1c5a1c1
Fix step-over behaviour followed by step-in instructions
NipunaRanasinghe Nov 29, 2024
c775dba
Merge pull request #43661 from gimantha/2201.11.0-stage
gimantha Nov 30, 2024
95e90fe
Merge pull request #43665 from NipunaRanasinghe/2201.11.0-stage
NipunaRanasinghe Nov 30, 2024
f793e5b
Make runtime calls synchronous
gimantha Dec 2, 2024
ce2986d
Fix checkstyle issue
gimantha Dec 2, 2024
ff7837e
Update netty version
NipunaMadhushan Dec 3, 2024
fb67d88
Merge pull request #43669 from NipunaMadhushan/update-netty-version
NipunaMadhushan Dec 3, 2024
5bafe98
Update execution context to support reset state
NipunaRanasinghe Dec 3, 2024
c23e419
Set encoded function name in lambda details
gimantha Dec 3, 2024
0d9e94d
Add support for restart requests
NipunaRanasinghe Dec 3, 2024
cf28096
Add full build pipeline for stage and `2201.x.x` branch pull requests
chiranSachintha Dec 3, 2024
6735dc3
Merge pull request #43680 from chiranSachintha/full-build-pipeline-pu…
chiranSachintha Dec 4, 2024
fc33b75
Merge pull request #43678 from gimantha/2201.11.0-stage-set-encoded-f…
chiranSachintha Dec 4, 2024
fb56dd8
Merge branch '2201.11.0-stage' into nutcracker
chiranSachintha Dec 4, 2024
38a426c
Fix a project caching issue during debugger restarts
NipunaRanasinghe Dec 4, 2024
f2ccd24
Fix #40606
gimantha Nov 17, 2024
9852424
Fix checkstyle issue
gimantha Nov 17, 2024
b860e50
Fix test failure
gimantha Nov 17, 2024
4dd1896
Check specifically the singleton path segments
gimantha Dec 2, 2024
6e2b43d
Refactor code to remove redundancies
NipunaRanasinghe Dec 4, 2024
f762dae
Merge pull request #43606 from ballerina-platform/nutcracker
chiranSachintha Dec 4, 2024
0d1e483
Merge pull request #43683 from gimantha/2201.11.0-stage-#40606
chiranSachintha Dec 4, 2024
ff88b2d
Fix sending vm exit notifications to the client
NipunaRanasinghe Dec 4, 2024
6585e57
Update debug test runner to support debug terminations
NipunaRanasinghe Dec 4, 2024
7aedf9f
Add debug restart tests
NipunaRanasinghe Dec 4, 2024
81b23a6
Fix spotbugs
NipunaRanasinghe Dec 4, 2024
ce89d14
Fix minor issues
NipunaRanasinghe Dec 4, 2024
55cee50
Fix more test failures
NipunaRanasinghe Dec 4, 2024
9b642cc
Merge pull request #43684 from NipunaRanasinghe/2201.11.0-stage
NipunaRanasinghe Dec 5, 2024
972fef9
Add optimization to compiler
heshanpadmasiri Dec 5, 2024
1379b4b
Add optimization to runtime
heshanpadmasiri Dec 5, 2024
0fab35b
Revert "Add optimization to runtime"
heshanpadmasiri Dec 5, 2024
f0d2dde
Update full build pipeline of PR build
chiranSachintha Dec 5, 2024
6e1e5c1
Remove level 11
chiranSachintha Dec 5, 2024
5e99d27
Update levels
chiranSachintha Dec 6, 2024
0c01583
Merge pull request #43689 from heshanpadmasiri/fix/bdd-optim
chiranSachintha Dec 9, 2024
6927813
Make the breakpoint verification configurable
NipunaRanasinghe Dec 6, 2024
fefc76c
Add tests
NipunaRanasinghe Dec 6, 2024
6c67206
Fix verification when the feature is enabled
NipunaRanasinghe Dec 6, 2024
6644b9c
Apply review suggestions
NipunaRanasinghe Dec 10, 2024
c4fe578
Merge pull request #43693 from NipunaRanasinghe/2201.11.0-stage
NipunaRanasinghe Dec 11, 2024
f0875b7
Improve perf of array add
warunalakshitha Dec 11, 2024
7e5f313
Improve perf of type checker for equal types
warunalakshitha Dec 11, 2024
0ccf421
Remove redundant equal check in TypeCheckCache
warunalakshitha Dec 11, 2024
f412009
Optimize function by removing unnecessary synchronized modifier
chiranSachintha Dec 12, 2024
2b57fa4
Fix test with int sub types
warunalakshitha Dec 12, 2024
a1e03c5
Merge pull request #43704 from chiranSachintha/remove-sync
chiranSachintha Dec 12, 2024
db42f71
Refactor semtype concurrency model
heshanpadmasiri Dec 14, 2024
5bbc764
Avoid unnnecessary calls to create context
heshanpadmasiri Dec 15, 2024
85b8270
Fix phase change interruptions
heshanpadmasiri Dec 16, 2024
64f3005
Fix bstring array tests
warunalakshitha Dec 16, 2024
8b46143
Merge branch 2201.11.0-stage
warunalakshitha Dec 16, 2024
617605d
Add self diagnostics to semtypes
heshanpadmasiri Dec 16, 2024
b0b8f79
Add locks to handle concurrent env rec atom creation
heshanpadmasiri Dec 16, 2024
91e04ff
Add dead lock detection to self diagnostics
heshanpadmasiri Dec 16, 2024
c7439b9
Rethrow any type resolution exceptions
heshanpadmasiri Dec 17, 2024
f4c6cb5
Lock all recursive definitions
heshanpadmasiri Dec 17, 2024
06e31a7
Diagnose empty rec atoms
heshanpadmasiri Dec 17, 2024
534f7b4
Remove workaround for BIR serialization
heshanpadmasiri Dec 17, 2024
ab2a1b5
Properly reset the phaser
heshanpadmasiri Dec 17, 2024
10289a1
Refactor strand dump logic and fix bug
ravinperera00 Dec 17, 2024
0021146
Handle BasicType checks with mutable semtypes
heshanpadmasiri Dec 17, 2024
479166c
Add move diagnostics
heshanpadmasiri Dec 17, 2024
9fcbf67
Fix state transition errors
heshanpadmasiri Dec 17, 2024
8229d95
Add more diagnostics
heshanpadmasiri Dec 17, 2024
4487308
avoid phase change on error
heshanpadmasiri Dec 17, 2024
f723bee
Simple CAS sync
heshanpadmasiri Dec 17, 2024
bf10b3e
Simplify the sync logic
heshanpadmasiri Dec 17, 2024
109f6cc
Merge pull request #43708 from heshanpadmasiri/fix/semtype-sycn
chiranSachintha Dec 18, 2024
0060bf1
Fix checkstyle issue
ravinperera00 Dec 19, 2024
e01fe53
Merge branch 2201.11.0-stage
warunalakshitha Dec 19, 2024
bc78653
Update runtime API documentation
HindujaB Dec 19, 2024
fbb3a35
Merge pull request #43701 from warunalakshitha/perf_fix_semtype
warunalakshitha Dec 19, 2024
9111ec1
Merge pull request #43713 from ravinperera00/strand_dump_2
warunalakshitha Dec 19, 2024
c6974d8
Fix breakpoint changes inside Ballerina services after starting a deb…
NipunaRanasinghe Jan 8, 2025
1f00f40
Revert "Merge pull request #43708 from heshanpadmasiri/fix/semtype-sycn"
chiranSachintha Jan 9, 2025
9b1b667
Revert "Merge pull request #43689 from heshanpadmasiri/fix/bdd-optim"
chiranSachintha Jan 9, 2025
da93307
Revert "Merge pull request #43606 from ballerina-platform/nutcracker"
chiranSachintha Jan 9, 2025
f57346b
Merge pull request #43740 from NipunaRanasinghe/debugger-bp-fix-Update11
NipunaRanasinghe Jan 9, 2025
e3ebc61
Update runtime `Typechecker`
chiranSachintha Jan 9, 2025
ce793f9
Revert "Merge pull request #43701 from warunalakshitha/perf_fix_semtype"
chiranSachintha Jan 9, 2025
54a9f5d
Revert "Update runtime `Typechecker`"
chiranSachintha Jan 9, 2025
8996d17
Update levels
chiranSachintha Jan 9, 2025
6ec7360
Merge pull request #43742 from chiranSachintha/2201.11.0-stage-revert
warunalakshitha Jan 9, 2025
cd9e541
Set default value fps isolated
warunalakshitha Jan 9, 2025
b4931ec
Avoid creating unwanted virtual threads
warunalakshitha Jan 9, 2025
c85851f
Merge pull request #43745 from warunalakshitha/java21_perf
warunalakshitha Jan 9, 2025
8c20325
Improve adding array value performance
warunalakshitha Jan 9, 2025
f28de19
Improve the Scheduler call logic
warunalakshitha Jan 9, 2025
cc82945
Merge pull request #43747 from warunalakshitha/java21_perf
warunalakshitha Jan 9, 2025
15de3b2
Merge pull request #43718 from HindujaB/2201.11.0-stage
warunalakshitha Jan 20, 2025
a4b67fe
Merge pull request #43746 from ballerina-platform/java21_perf
warunalakshitha Jan 22, 2025
e105b20
Avoid using gradle release plugin
NipunaMadhushan Feb 6, 2025
5b91c57
Merge pull request #43801 from NipunaMadhushan/fix-u11-release
NipunaMadhushan Feb 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ jobs:
git config user.name ${{ secrets.BALLERINA_BOT_USERNAME }}
git config user.email ${{ secrets.BALLERINA_BOT_EMAIL }}
git checkout -b release-${VERSION}
./gradlew release -Prelease.useAutomaticVersion=true
./gradlew build -Pversion=${VERSION}
./gradlew -Pversion=${VERSION} publish -x test --continue
- name: Create Release Tag
run: |
git config --local user.name ${{ secrets.BALLERINA_BOT_USERNAME }}
git config --local user.email ${{ secrets.BALLERINA_BOT_EMAIL }}
git tag -a v${VERSION} -m "Release v${VERSION}"
git push origin v${VERSION}
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
- name: Create Github release from the release tag
run: |
curl --request POST 'https://api.github.com/repos/ballerina-platform/ballerina-lang/releases' \
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pull_request_full_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
branches:
- master
- 2201.[0-9]+.x
- 2201.[0-9]+.[0-9]+-stage

jobs:
build-lang:
Expand Down Expand Up @@ -59,7 +61,7 @@ jobs:
strategy:
fail-fast: false
matrix:
level: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
level: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]

steps:
- name: Checkout Repository
Expand Down
127 changes: 71 additions & 56 deletions bvm/ballerina-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ Dependency versions can be found [here](https://github.com/ballerina-platform/ba
## Ballerina Java Runtime API
Ballerina runtime API will contain the following sub packages.

| **Package** | **Description** |
|---------------------------------------|--------------------------------------------------|
| io.ballerina.runtime.api | Basic runtime constructs |
| io.ballerina.runtime.api.concurrent | Handle Ballerina asynchronous related constructs |
| io.ballerina.runtime.api.constants | Runtime constants |
| io.ballerina.runtime.api.creators | APIs to create types, values, etc. |
| io.ballerina.runtime.api.flags | Runtime flags |
| io.ballerina.runtime.api.launch | Constructs for startup runtime |
| io.ballerina.runtime.api.types | Represent Ballerina Java types |
| io.ballerina.runtime.api.utils | Utils methods |
| io.ballerina.runtime.api.utils.values | Represent Ballerina Java values |
| **Package** | **Description** |
|-------------------------------------|-----------------------------------------------------|
| io.ballerina.runtime.api | Basic runtime constructs |
| io.ballerina.runtime.api.concurrent | Handle Ballerina-related asynchronous constructs |
| io.ballerina.runtime.api.constants | Runtime constants |
| io.ballerina.runtime.api.creators | APIs to create types, values, errors, etc. |
| io.ballerina.runtime.api.flags | Runtime flags for types and symbols |
| io.ballerina.runtime.api.repository | Runtime repository constructs for remote-management |
| io.ballerina.runtime.api.types | Represent Ballerina Java types |
| io.ballerina.runtime.api.utils | Utils methods |
| io.ballerina.runtime.api.values | Represent Ballerina Java values |

## Map Java types to Ballerina types
The following table summarizes how Java types are mapped to corresponding Ballerina types. This is applicable when mapping a return type of a Java method to a Ballerina type.
Expand Down Expand Up @@ -98,13 +98,12 @@ The following table summarizes how Ballerina types are mapped to corresponding J

## Main API constructs

| **Construct** | **Description** |
|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| io.ballerina.runtime.api.Environment | Developers can use this as the first argument of an interop method, Ballerina will inject an instance of `Environment` class when calling. That instance can be used to communicate with the currently executing Ballerina runtime. With `Environment` instance, you can get interop Ballerina function name, path parameters, strand id, strand metadata, current module, current runtime, etc. |
| io.ballerina.runtime.api.Future | This will contain the future value once we call the Ballerina method from API asynchronously. |
| io.ballerina.runtime.api.Module | Represent Java runtime module. |
| **Construct** | **Description** |
|------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| io.ballerina.runtime.api.Environment | Developers can use this as the first argument of an interop method, Ballerina will inject an instance of `Environment` class when calling. That instance can be used to communicate with the currently executing Ballerina runtime. With `Environment` instance, you can get interop Ballerina function name, path parameters, strand id, strand metadata, current module, current runtime, etc. |
| io.ballerina.runtime.api.Module | Represent Java runtime module. |
| io.ballerina.runtime.api.types.PredefinedTypes | Contains predefined types. |
| io.ballerina.runtime.api.Runtime | An instance of the current runtime can be obtained through an `Environment` instance. This will contain APIs to call Ballerina object methods asynchronously. |
| io.ballerina.runtime.api.Runtime | An instance of the current runtime can be obtained through an `Environment` instance. This will contain APIs to call Ballerina object methods asynchronously. |
| io.ballerina.runtime.api.types.TypeTags | Contains runtime type tags. |

## Create a Ballerina value
Expand Down Expand Up @@ -134,23 +133,16 @@ types will not work correctly in the Ballerina code since those type definitions

Those can only be used for Java unit tests.

## Calling a Ballerina object method

Ballerina runtime exposes APIs to call a Ballerina object method and Ballerina function pointer using Java.

`io.ballerina.runtime.api.Runtime` class exposes two Java APIs to call object methods.

1. `invokeMethodAsyncSequentially`

Invoke the object method asynchronously and sequentially. This method will ensure that the object methods are invoked in the same thread where other object methods are executed. So, the methods will be executed sequentially per object level.
## Calling Ballerina object methods and functions

2. `invokeMethodAsyncConcurrently`
Ballerina runtime exposes APIs to call Ballerina object methods and functions using Java. If the method is called with an available running strand, the method will be executed in the same strand. The caller can decide whether to execute the method concurrently or sequentially using the `StrandMetadata` argument.
The `isConcurrentSafe` property of the `StrandMetadata` argument should be set to `true` only if the caller guarantees that the mutable state is free of data races for the given method and arguments, allowing the method to run concurrently.

Invoke the object method asynchronously and concurrently. The caller needs to ensure that no data race is possible for the mutable state with a given object method and arguments so that the method can be concurrently run with different OS threads.
## Calling a Ballerina object method

>**Note:** If the caller can ensure that the given object and object method are isolated and no data race is possible for the mutable state with given arguments, use `invokeMethodAsyncConcurrently`, otherwise use `invokeMethodAsyncSequentially`. We can decide the object method isolation if and only if both `object.getType().isIsolated()` and `object.getType().isIsolated(methodName)` return `true`.
Ballerina runtime exposes `callMethod` API to call a Ballerina object method using the `io.ballerina.runtime.api.Runtime` class.

The following code shows an example of calling an isolated method using Java API.
The following code shows an example of calling an object method using Java API.

#### Ballerina

Expand Down Expand Up @@ -178,35 +170,64 @@ public class Person {

public function main() {
Person p = new Person("John", 30);
string sport = p.callPlay("football");
string sport = p.callPlayWithArgs("football");
}
```

#### Java

```java
class Test {
public static BString callPlay(Environment env, BObject object, BString bString) {
env.getRuntime().invokeMethodAsyncConcurrently(object, "play", "play", null,
new Callback() {
@Override
public void notifySuccess(Object result) {
future.complete(result);
}

@Override
public void notifyFailure(BError error) {
future.complete(error);
}
}, null, PredefinedTypes.TYPE_STRING, bString, true);
return null;
}
public static BString callPlayWithArgs(Environment env, BObject object, BString bString) {
return env.getRuntime().callMethod(object, "play", null, bString);
}
}
```

## Calling a Ballerina function

Ballerina runtime exposes APIs to call a Ballerina function using Java. This can be done in two ways that are described below.

### Calling a Function using `io.ballerina.runtime.api.Runtime` class

Developers can call a Ballerina function using the `io.ballerina.runtime.api.Runtime` class. This class exposes the `callFunction` method to call a Ballerina function.

E.g.

#### Ballerina

The following Ballerina code defines a function in module `foo` from organization `testOrg`.

```ballerina

public function main() returns error? {
boolean b = <boolean>callIsEven(2);
}

function isEven(int n) returns boolean {
return n % 2 == 0;
}

public isolated function callIsEven(int n) returns any = @java:Method {
'class: "org.ballerinalang.examples.Test",
name: "callIsEven"
} external;
```

#### Java

```java

class Test {
public static Object callIsEven(Environment env, long arg) {
return env.getRuntime().callFunction(new Module("testOrg", "foo"), "isEven", null, arg);
}
}
```

### Calling a Function Pointer

Developers can call a function through a function pointer which passes through an interop function. Runtime exposes the `asyncCall` method in `io.ballerina.runtime.api.values.BFunctionPointer` class.
Developers can call a function through a function pointer which passes through an interop function. Runtime exposes the `call` method in `io.ballerina.runtime.api.values.BFunctionPointer` class.

E.g.

Expand All @@ -233,15 +254,9 @@ public isolated function invokeFunctionPointer(function func, any|error... args)

```java
class Test {
public static Object invokeFunctionPointer(Object func, Object[] args) {
public static Object invokeFunctionPointer(Environment env, Object func, Object[] args) {
BFunctionPointer function = (BFunctionPointer) func;
List<Object> argList = new ArrayList<>();
for (Object arg : args) {
argList.add(arg);
argList.add(true); // Due to a limitation in the current API we need to pass `true` as every other
// parameter value to handle default values.
}
return function.asyncCall(argList.toArray(), o -> o, METADATA);
return function.call(env.getRuntime(), args);
}
}
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
import io.ballerina.runtime.internal.errors.ErrorCodes;
import io.ballerina.runtime.internal.errors.ErrorHelper;
import io.ballerina.runtime.internal.launch.LaunchUtils;
import io.ballerina.runtime.internal.scheduling.AsyncUtils;
import io.ballerina.runtime.internal.scheduling.RuntimeRegistry;
import io.ballerina.runtime.internal.scheduling.Scheduler;
import io.ballerina.runtime.internal.values.FutureValue;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -74,9 +72,7 @@ public Object init() {
handleAlreadyCalled(moduleInitialized, "init");
try {
this.invokeConfigInit();
FutureValue future = scheduler.startIsolatedFunction(rootModule, "$moduleInit",
new StrandMetadata(true, null));
Object result = AsyncUtils.getFutureResult(future.completableFuture);
Object result = scheduler.callFunction(rootModule, "$moduleInit", new StrandMetadata(true, null));
this.moduleInitialized = true;
return result;
} catch (ClassNotFoundException e) {
Expand Down Expand Up @@ -212,11 +208,11 @@ private void validateArgs(BObject object, String methodName) {
}
}

Object invokeModuleStop() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
void invokeModuleStop() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
IllegalAccessException {
Class<?> configClass = loadClass(MODULE_INIT_CLASS_NAME);
Method method = configClass.getDeclaredMethod("$currentModuleStop", BalRuntime.class);
return method.invoke(null, this);
method.invoke(null, this);
}

protected Class<?> loadClass(String className) throws ClassNotFoundException {
Expand Down
Loading