From 8a8b169e67bcca7addc56291926f9303bd148d73 Mon Sep 17 00:00:00 2001 From: Terence Parr Date: Tue, 14 Apr 2015 16:47:32 -0700 Subject: [PATCH] reorder bytecodes --- src/vm/Bytecode.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vm/Bytecode.java b/src/vm/Bytecode.java index e3acfbc..facbd0c 100644 --- a/src/vm/Bytecode.java +++ b/src/vm/Bytecode.java @@ -27,9 +27,11 @@ public Instruction(String name, int nargs) { public static final short GSTORE = 13; // store in global memory public static final short PRINT = 14; // print stack top public static final short POP = 15; // throw away top of stack - public static final short HALT = 16; - public static final short CALL = 17; - public static final short RET = 18; // return with/without value + public static final short CALL = 16; + public static final short RET = 17; // return with/without value + + + public static final short HALT = 19; public static Instruction[] instructions = new Instruction[] { null, // @@ -48,8 +50,8 @@ public Instruction(String name, int nargs) { new Instruction("gstore", 1), new Instruction("print"), new Instruction("pop"), - new Instruction("halt"), new Instruction("call", 2), // call addr, nargs - new Instruction("ret") + new Instruction("ret"), + new Instruction("halt") }; }