Skip to content

Kotlin: Unify loop break/continue statement handling between java and kotlin #9153

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

Merged
merged 9 commits into from
Jun 24, 2022

Conversation

tamasvajk
Copy link
Contributor

This PR removes the kotlin relations for loops, break and continue statements and instead uses the java equivalents.

The PR removes DB structures, so it requires new stats generation and upgrade folder.

@github-actions github-actions bot added the Java label May 13, 2022
@tamasvajk tamasvajk force-pushed the kotlin-simplify-loop-breaks-1 branch from 76a757a to 0aad8bf Compare May 20, 2022 14:11
@tamasvajk tamasvajk force-pushed the kotlin-simplify-loop-breaks-1 branch from 0aad8bf to b9b1031 Compare May 31, 2022 06:52
@github-actions github-actions bot added the Kotlin label Jun 1, 2022
@tamasvajk tamasvajk marked this pull request as ready for review June 13, 2022 07:47
@tamasvajk tamasvajk requested review from a team as code owners June 13, 2022 07:47
@tamasvajk tamasvajk added the no-change-note-required This PR does not need a change note label Jun 13, 2022
@tamasvajk tamasvajk removed the no-change-note-required This PR does not need a change note label Jun 13, 2022
@tamasvajk tamasvajk force-pushed the kotlin-simplify-loop-breaks-1 branch 2 times, most recently from b1ffd82 to 3224dc6 Compare June 21, 2022 08:09
@tamasvajk tamasvajk force-pushed the kotlin-simplify-loop-breaks-1 branch 2 times, most recently from 79072b4 to 83bf91b Compare June 23, 2022 06:43
@tamasvajk tamasvajk force-pushed the kotlin-simplify-loop-breaks-1 branch from 83bf91b to e68e09c Compare June 23, 2022 06:45
@tamasvajk tamasvajk force-pushed the kotlin-simplify-loop-breaks-1 branch from e68e09c to 3d3b55d Compare June 23, 2022 06:46
Fixes the bad join order in `Shadowing::shadows`:
Tuple counts for Shadowing::shadows#f4fb89a3#ffff@c4b8a90j:
           182915  ~0%    {2} r1 = Variable::LocalVariableDecl::getCallable#dispred#f0820431#ff AND NOT Shadowing::shadows#f4fb89a3#ffff#antijoin_rhs(Lhs.0, Lhs.1)
           182915  ~0%    {3} r2 = JOIN r1 WITH localvars ON FIRST 1 OUTPUT Lhs.1, Lhs.0, Rhs.2
           182915  ~3%    {4} r3 = JOIN r2 WITH Member::Member::getDeclaringType#dispred#f0820431#bf ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0, Lhs.2
           182833  ~0%    {4} r4 = JOIN r3 WITH classes ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Lhs.3, Lhs.0
           182833  ~3%    {5} r5 = JOIN r4 WITH Element::Element::getName#dispred#f0820431#ff ON FIRST 1 OUTPUT Lhs.2, Lhs.0, Lhs.1, Lhs.3, Rhs.1
        183352620  ~5%    {5} r6 = JOIN r5 WITH Member::Field::getType#dispred#f0820431#bf_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.3, Lhs.1, Lhs.2, Lhs.4
            40529  ~0%    {5} r7 = JOIN r6 WITH Member::Field::getDeclaringType#dispred#f0820431#fb ON FIRST 2 OUTPUT Lhs.0, Lhs.4, Lhs.2, Lhs.3, Lhs.1
              678  ~4%    {4} r8 = JOIN r7 WITH Element::Element::getName#dispred#f0820431#ff ON FIRST 2 OUTPUT Lhs.2, Lhs.3, Lhs.4, Lhs.0
              670  ~4%    {4} r9 = r8 AND NOT Member::Field::isStatic#dispred#f0820431#b(Lhs.3)
              670  ~3%    {4} r10 = SCAN r9 OUTPUT In.0, In.2, In.3, In.1
                          return r10

After the fix:
Tuple counts for Shadowing::shadows#f4fb89a3#ffff@95ca976v:
        182915  ~0%    {2} r1 = Variable::LocalVariableDecl::getCallable#dispred#f0820431#ff AND NOT Shadowing::shadows#f4fb89a3#ffff#antijoin_rhs(Lhs.0, Lhs.1)
        182915  ~0%    {3} r2 = JOIN r1 WITH localvars ON FIRST 1 OUTPUT Lhs.1, Lhs.0, Rhs.2
        182915  ~0%    {4} r3 = JOIN r2 WITH Member::Member::getDeclaringType#dispred#f0820431#bf ON FIRST 1 OUTPUT Lhs.1, Lhs.0, Lhs.2, Rhs.1
        182915  ~7%    {5} r4 = JOIN r3 WITH Element::Element::getName#dispred#f0820431#ff ON FIRST 1 OUTPUT Lhs.3, Rhs.1, Lhs.2, Lhs.0, Lhs.1
           678  ~4%    {4} r5 = JOIN r4 WITH Shadowing::getField#f4fb89a3#ffff ON FIRST 3 OUTPUT Lhs.3, Lhs.4, Lhs.0, Rhs.3
           670  ~4%    {4} r6 = r5 AND NOT Member::Field::isStatic#dispred#f0820431#b(Lhs.3)
           670  ~3%    {4} r7 = SCAN r6 OUTPUT In.0, In.2, In.3, In.1
                       return r7
@tamasvajk tamasvajk force-pushed the kotlin-simplify-loop-breaks-1 branch from 45c815b to cf18a9a Compare June 23, 2022 08:33
@tamasvajk tamasvajk merged commit 381bcf7 into github:main Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants