-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for inlining method calls
The compiler is now able to inline calls to static and instance methods. For each method we calculate a rough weight/cost, and calls are inlined into their callers until the maximum weight is reached. Inlining is done bottom-up using Tarjan's strongly connected components algorithm, reducing the amount of duplicate inlining work. Inlining is also done in a deterministic order as to ensure incremental compilation caches can be reused as much as possible. The current inlining threshold is on the conservative end as to not increase compile times and compile-time memory usage too much. Over time we may relax this based on user reports and any extra optimization passes we might add. If a method is annotated with the `inline` keyword, it's _always_ inlined into the caller regardless of it or the caller's weight. This is meant to be used when you want to guarantee a method is inlined, such as for the various operator methods of Int, Float, Bool, etc. Because of this guarantee one should use it sparingly, as to not increase the compile time and executable size too much. This fixes #343. Changelog: added
- Loading branch information
1 parent
9f68de6
commit aaaa2f6
Showing
64 changed files
with
4,136 additions
and
2,358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
pub mod lexer; | ||
pub mod nodes; | ||
pub mod parser; | ||
pub mod source_location; |
Oops, something went wrong.