1.1 --- a/vm/src/main/java/org/apidesign/vm4brwsr/Variable.java Fri Dec 07 15:02:35 2012 +0100
1.2 +++ b/vm/src/main/java/org/apidesign/vm4brwsr/Variable.java Wed Dec 12 11:04:02 2012 +0100
1.3 @@ -18,15 +18,8 @@
1.4 package org.apidesign.vm4brwsr;
1.5
1.6 public final class Variable implements CharSequence {
1.7 - public static final int TYPE_INT = 0;
1.8 - public static final int TYPE_LONG = 1;
1.9 - public static final int TYPE_FLOAT = 2;
1.10 - public static final int TYPE_DOUBLE = 3;
1.11 - public static final int TYPE_REF = 4;
1.12 -
1.13 - public static final int LAST_TYPE = TYPE_REF;
1.14 -
1.15 private static final String STACK_VAR_PREFIX = "st";
1.16 + private static final String LOCAL_VAR_PREFIX = "lc";
1.17
1.18 private final String name;
1.19 private final int type;
1.20 @@ -46,6 +39,12 @@
1.21 return new Variable(STACK_VAR_PREFIX, type, index);
1.22 }
1.23
1.24 + public static Variable getLocalVariable(
1.25 + final int type, final int index) {
1.26 + // TODO: precreate frequently used variables
1.27 + return new Variable(LOCAL_VAR_PREFIX, type, index);
1.28 + }
1.29 +
1.30 public String getName() {
1.31 return name;
1.32 }
1.33 @@ -59,7 +58,7 @@
1.34 }
1.35
1.36 public boolean isCategory2() {
1.37 - return (type == TYPE_LONG) || (type == TYPE_DOUBLE);
1.38 + return VarType.isCategory2(type);
1.39 }
1.40
1.41 @Override