Few more instructions
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Tue, 25 Sep 2012 12:38:07 +0200
changeset 313072c9fab69c
parent 30 7efb52f76270
child 32 82476405e1ad
Few more instructions
vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java
     1.1 --- a/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java	Tue Sep 25 12:26:29 2012 +0200
     1.2 +++ b/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java	Tue Sep 25 12:38:07 2012 +0200
     1.3 @@ -238,6 +238,15 @@
     1.4                      out.append("stack.push(arg").append(indx + ");");
     1.5                      break;
     1.6                  }
     1.7 +                case bc_istore:
     1.8 +                case bc_lstore:
     1.9 +                case bc_fstore:
    1.10 +                case bc_dstore:
    1.11 +                case bc_astore: {
    1.12 +                    final int indx = (byteCodes[++i] + 256) % 256;
    1.13 +                    out.append("arg" + indx).append(" = stack.pop()");
    1.14 +                    break;
    1.15 +                }
    1.16                  case bc_astore_0:
    1.17                  case bc_istore_0:
    1.18                  case bc_lstore_0:
    1.19 @@ -537,6 +546,10 @@
    1.20                  case bc_bipush:
    1.21                      out.append("stack.push(" + byteCodes[++i] + ");");
    1.22                      break;
    1.23 +                case bc_sipush:
    1.24 +                    out.append("stack.push(" + readIntArg(byteCodes, i) + ");");
    1.25 +                    i += 2;
    1.26 +                    break;
    1.27                  case bc_getfield: {
    1.28                      int indx = readIntArg(byteCodes, i);
    1.29                      CPFieldInfo fi = (CPFieldInfo) jc.getConstantPool().get(indx);