-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary Remove subroutine support from the VM and L3-0. This significantly simplifies the VM and brings the target languages closer together, thus reducing future work and simplifying the overall compiler architecture. ## Details * remove the subroutine-related VM instructions * simplify the VM's exception handling; the dedicated EH code is obsolete and thus removed * adjust the `err_goto` grammar and associated tests * remove the `Subroutine` grammar from L3-0 * remove the now-unused `Subroutine` and `List` node kinds * remove tests for subroutines ### Motivation The motivation behind removing low-level subroutines is two-fold: 1. they only exist for the VM target - asm.js, Wasm, and C don't have them -, which complicates the compiler architecture 2. they have a fairly high implementation complexity in the VM Number 1 is the main reason for the removal. Languages without low- level subroutines need a local + `Select` dispatcher to emulate them. This lowering would be best be implemented at a higher-level, so that the optimization passed can take the locals' data-flow into account, but this requires all ILs below to support two dialects: one with and one without subroutines. Alternatively, the lowering could be done at a lower level, but this would result in the same dialect problem as the other approach (although to a lesser degree), and it'd also result in worse code generation. Since low-level subroutines are only an optimization, and the VM is the only target out of the planned ones to support it, removing them is the overall better choice, as it reduced the surface area of ILs and the VM, as well as making lowering passes from subroutines into dispatchers unnecessary.
- Loading branch information
Showing
18 changed files
with
50 additions
and
543 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
.local lo0 int | ||
LdImmInt 10 | ||
Raise | ||
.eh ((Except L2)) | ||
.eh L2 | ||
.label L2 | ||
Except | ||
PopLocal lo0 | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.