Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

[inlining] Revised inlining implementation #822

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

wrwg
Copy link
Member

@wrwg wrwg commented Jan 14, 2023

This is a new implementation of inlining which uses eager (call-by-value) parameter passing. This makes inline functions semantically fully compatible with regular functions. The new implementation also fixes some name clash problems.

Functionals for vector have been added and tested. Moreover, documentation has been added to the Move reference.

The related AIP is here: aptos-foundation/AIPs#36

@wrwg wrwg force-pushed the inline2 branch 4 times, most recently from 289926b to 4c902f4 Compare January 15, 2023 05:45
This is a new implementation of inlining which uses eager (call-by-value) parameter passing. This makes inline functions semantically fully compatible with regular functions. The new implementation also fixes some name clash problems.

The suggested functionals for vector have been added and tested. Moreover, documentation has been added to the Move reference.
@wrwg wrwg enabled auto-merge (squash) January 15, 2023 23:39
@wrwg wrwg disabled auto-merge January 15, 2023 23:39
Copy link
Collaborator

@meng-xu-cs meng-xu-cs left a comment

Choose a reason for hiding this comment

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

Stamping to unblock.

This PR could enjoy a bit more testing on the new addition of inferred ability part although the testing could also come later.

f(_x);
}

public fun test_shadowing() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a mind-tweaking (in a good way) test case....

@wrwg
Copy link
Member Author

wrwg commented Jan 17, 2023

This PR could enjoy a bit more testing on the new addition of inferred ability part although the testing could also come later.

This actually fundamental in the entire working of this PR. There is e.g. code where we need do the following:

 let mut ty = Type_::multiple(loc, tys);
 self.infer_abilities(&mut ty);

Subsequent phases expect that Type_::Apply has fully populated abilities. This information is populated by the typing phase, but we run after it. We need to maintain the state of typed AST, and without this inference, nothing would work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants