Package erjang.beam.repr.Operands

Examples of erjang.beam.repr.Operands.ByteString


        return new Insn.Y(opcode, y);
      }

      case bs_put_string:
      {
        ByteString bin = readBytestringRef();
        return new Insn.By(opcode, bin);
      }

      //---------- 2-ary ----------
      case allocate:
      case allocate_zero:
      case trim:
      case apply_last:
      {
        int i1 = readCodeInteger();
        int i2 = readCodeInteger();
        return new Insn.II(opcode, i1, i2);
      }

      case test_heap:
      {
        AllocList al = readAllocList();
        int i2 = readCodeInteger();
        return new Insn.WI(opcode, al, i2);
      }

      case call:
      case call_only:
      {
        int i1 = readCodeInteger();
        Label label = readLabel();
        return new Insn.IL(opcode, i1, label,
                   functionAtLabel(label.nr));
      }

      case call_ext:
      case call_ext_only:
      {
        int i1 = readCodeInteger();
        int ext_fun_ref = readCodeInteger();
        return new Insn.IE(opcode, i1, extFun(ext_fun_ref));
      }

      case bs_save2:
      case bs_restore2:
      {
        DestinationOperand dest = readDestination();

        int i2;
        if ((peekTag() & 0x7) == ATOM4_TAG) {
          if (readAtom().getEAtom() != START_ATOM)
            throw new IOException("integer or 'start' expected");
          i2 = -1;
        } else i2 = readCodeInteger();
        return new Insn.DI(opcode, dest, i2, true);
      }

      case move:
      case fmove:
      case fconv:
      {
        SourceOperand src = readSource();
        DestinationOperand dest = readDestination();
        return new Insn.SD(opcode, src, dest);
      }

      case put_tuple:
      {
        int i1 = readCodeInteger();
        DestinationOperand dest = readDestination();
        return new Insn.ID(opcode, i1, dest);
      }

      case loop_rec:
      {
        Label label = readLabel();
        DestinationOperand dest = readDestination();
        return new Insn.LD(opcode, label, dest);
      }

      case K_try:
      case K_catch:
      {
        YReg y = readYReg();
        Label label = readLabel();
        return new Insn.YL(opcode, y, label);
      }

      case is_integer:
      case is_float:
      case is_number:
      case is_atom:
      case is_pid:
      case is_reference:
      case is_port:
      case is_nil:
      case is_binary:
      case is_list:
      case is_nonempty_list:
      case is_tuple:
      case is_function:
      case is_boolean:
      case is_bitstr:
      {
        Label label = readLabel();
        DestinationOperand src = readDestination();
        return new Insn.LD(opcode, label, src, true);
      }

      case wait_timeout:
      {
        Label label = readLabel();
        SourceOperand src = readSource();
        return new Insn.LS(opcode, label, src, false);
      }

      case raise:
      {
        SourceOperand src1 = readSource();
        SourceOperand src2 = readSource();
        return new Insn.SS(opcode, src1, src2);
      }

      case put_string:
      {
        ByteString bin = readBytestringRef();
        DestinationOperand dest = readDestination();
        return new Insn.ByD(opcode, bin, dest);
      }

      //---------- 3-ary ----------
View Full Code Here


    return new BitString(bitstring(start,bits));
    }
    public ByteString readBytestringRef() throws IOException {
    int bytes  = readCodeInteger();
    int start = readCodeInteger();
    return new ByteString(string(start,bytes));
    }
View Full Code Here

TOP

Related Classes of erjang.beam.repr.Operands.ByteString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.