summaryrefslogtreecommitdiff
path: root/V2VM.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-24 21:05:15 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-24 21:05:15 -0600
commit62091005231095abbf8e2cebbfce708815cb63f0 (patch)
tree5186bf7db88b20704a48ab14413349291675ea82 /V2VM.java
parent0bbc4cb511bd90cebf94ccfcfce5ff8983ebb918 (diff)
Added VaporizeVisitor, with VAssign, VMemRead, and VMemWrite
Diffstat (limited to 'V2VM.java')
-rw-r--r--V2VM.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/V2VM.java b/V2VM.java
index 1dfa4cf..ef3d9f6 100644
--- a/V2VM.java
+++ b/V2VM.java
@@ -38,9 +38,20 @@ public class V2VM {
for (LIRDict interval : lvs) {
MinimalLogger.info(String.format("Starting Linear Allocation for %s...",
interval.getFunction()));
- new RegisterAlloc(interval, Arrays.copyOfRange(prog.registers, 6, 22));
+ new RegisterAlloc(interval, Arrays.copyOfRange(prog.registers, 9, 22)); // spill registers: t0, t1, t2
}
+ MinimalLogger.info("Removing extraneous lines from the program representation...");
+ for (String line : new ArrayList<String>(strProg)) {
+ // delete all lines not a function table!
+ if (!line.trim().startsWith("const") && !line.trim().startsWith(":"))
+ strProg.remove(line);
+ }
+ MinimalLogger.info(String.format("New program: %s",
+ strProg.toString()));
+ VaporizeVisitor vv = new VaporizeVisitor(prog, strProg, lvs);
+ System.out.println(String.join("\n", vv.getVaporm()));
+
} catch (IOException e) {
System.out.println(e.toString());
System.exit(1);