From be2822416c49de24d2a143678b5a107d51fd11bf Mon Sep 17 00:00:00 2001 From: Apoorva Ranade Date: Fri, 7 May 2021 21:28:07 +0530 Subject: [PATCH 1/2] Removed unused functions and imports --- src/main/java/chocopy/pa3/CodeGenImpl.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/chocopy/pa3/CodeGenImpl.java b/src/main/java/chocopy/pa3/CodeGenImpl.java index 0059099..243240b 100644 --- a/src/main/java/chocopy/pa3/CodeGenImpl.java +++ b/src/main/java/chocopy/pa3/CodeGenImpl.java @@ -1,9 +1,7 @@ package chocopy.pa3; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Stack; import chocopy.common.analysis.*; @@ -219,21 +217,11 @@ public class CodeGenImpl extends CodeGenBase { //handle used to free the register registerAvilMap[handle] = true; } - - private int getParamLocationOffset(int index, int paramSize) - { - return (paramSize - index - 1) * wordSize; - } - + private int getLocalVarLocationOffset(int index, int paramSize) { return - (index - paramSize + 1) * wordSize; } - private int getStaticLinkOffset(int paramSize) - { - return paramSize * wordSize; - } - /** * An analyzer for the function described by FUNCINFO0, which is null for the * top level. From d314b2841bf7298a27bea43ca0e42ddfc5505b5f Mon Sep 17 00:00:00 2001 From: Apoorva Ranade Date: Fri, 7 May 2021 21:44:36 +0530 Subject: [PATCH 2/2] Dummy.s --- src/main/asm/chocopy/common/dummy.s | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/main/asm/chocopy/common/dummy.s diff --git a/src/main/asm/chocopy/common/dummy.s b/src/main/asm/chocopy/common/dummy.s new file mode 100644 index 0000000..dca2717 --- /dev/null +++ b/src/main/asm/chocopy/common/dummy.s @@ -0,0 +1,5 @@ + jr ra + +.globl initchars +initchars: + jr ra \ No newline at end of file