-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor IR generation and assembly code generation
- Removed unused JUnit dependencies from submodule POMs - Print full IR code in Compiler before assembly - Handle empty blocks gracefully in IR generation - Emit function names without parentheses for builtins - Use load/store instead of iload/istore opcodes - Support strings and booleans in IntVal - Fix bugs in CJMP codegen - Add lombok dependency for logging - Improve comments and log messages
- Loading branch information
Showing
16 changed files
with
163 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,43 @@ | ||
.def dec1: args=1 ,locals=1: | ||
.def dec1: args=1 ,locals=1 | ||
load 0 | ||
iconst 1 | ||
iload 0 | ||
isub | ||
br L2 | ||
L2: | ||
ret | ||
.def main: args=0 ,locals=1: | ||
.def main: args=0 ,locals=1 | ||
iconst 10 | ||
istore 0 | ||
store 0 | ||
br L5 | ||
L5: | ||
load 0 | ||
iconst 0 | ||
iload 0 | ||
igt | ||
brf L7 | ||
L6: | ||
load 0 | ||
iconst 5 | ||
iload 0 | ||
igt | ||
brf L9 | ||
L8: | ||
iload 0 | ||
call print() | ||
load 0 | ||
load 0 | ||
iconst 7 | ||
iload 0 | ||
brf L11 | ||
ieq | ||
brf L9 | ||
L10: | ||
iconst 7 | ||
br L4 | ||
L9: | ||
call print() | ||
iload 0 | ||
sconst "break" | ||
load 0 | ||
call dec1() | ||
istore 0 | ||
store 0 | ||
br L5 | ||
L7: | ||
iconst 0 | ||
br L4 | ||
L4: | ||
ret | ||
halt |
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
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
Oops, something went wrong.