Package org.allspice.bytecode.instructions

Examples of org.allspice.bytecode.instructions.Nop


    md = md.addInstructions(
        new Load(x),
        new IfNotEquals0(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
        new Nop(one),
        new Const(true),
        new Return(TypeCode.BOOLEAN)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here


        new Load(x),
        new Load(y),
        new IfGreaterThan(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
        new Nop(one),
        new Const(true),
        new Return(TypeCode.BOOLEAN)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

    Mark three = new Mark() ;
    Mark others = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new LookupSwitch(new FIFO<CaseLabel>(new CaseLabel(3,three),new CaseLabel(1,one),new CaseLabel(2,two),new CaseLabel(null,others))),
        new Nop(one),new Const(1.0),new Return(TypeCode.DOUBLE),
        new Nop(two),new Const(2.0),new Return(TypeCode.DOUBLE),
        new Nop(three),new Const(3.0),new Return(TypeCode.DOUBLE),
        new Nop(others),new Const(0.0),new Return(TypeCode.DOUBLE)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

        new Load(x),
        new Load(y),
        new IfLessThanEq(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
        new Nop(one),
        new Const(true),
        new Return(TypeCode.BOOLEAN)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

    Mark start_pc = new Mark() ;
    Mark end_pc = new Mark() ;
    Mark the_end = new Mark() ;
    Mark handler = new Mark() ;
    md = md.addInstructions(
        new Nop(start_pc),
        new Load(x),
        new Throw(),
        new Nop(end_pc),
        new Goto(the_end),
        new ExceptionHandler(start_pc,end_pc,handler,new TypeName("java.lang.Exception")),
        new Nop(handler),
        new Store(ex),
        new Const(1),
        new Return(TypeCode.INT),
        new Nop(the_end),
        new Const(2),
        new Return(TypeCode.INT)
        ) ;
    cd = cd.addMethod(md)
    return cd ;
View Full Code Here

    l.add(new IfEquals0(context.getTypeCode(lhs),isZero)) ;
    context.compile(null,rhs, l) ;
    l.add(new IfEquals0(context.getTypeCode(rhs),isZero)) ;
    l.add(new Const(Boolean.TRUE)) ;
    l.add(new Goto(end)) ;
    l.add(new Nop(isZero)) ;
    l.add(new Const(Boolean.FALSE)) ;
    l.add(new Nop(end)) ;
  }
View Full Code Here

    l.add(new IfNotEquals0(context.getTypeCode(lhs),isOne)) ;
    context.compile(null,rhs, l) ;
    l.add(new IfNotEquals0(context.getTypeCode(rhs),isOne)) ;
    l.add(new Const(Boolean.FALSE)) ;
    l.add(new Goto(end)) ;
    l.add(new Nop(isOne)) ;
    l.add(new Const(Boolean.TRUE)) ;
    l.add(new Nop(end)) ;
  }
View Full Code Here

    createConvert(context,rhs,t,l) ;
    Mark end = new Mark() ;
    l.add(i) ;
    l.add(new Const(Boolean.FALSE)) ;
    l.add(new Goto(end)) ;
    l.add(new Nop(isTrue)) ;
    l.add(new Const(Boolean.TRUE)) ;
    l.add(new Nop(end)) ;
  }
View Full Code Here

    l.add(new LookupSwitch(labels)) ;
    for(Statement s: statements) {
      if (s instanceof CaseStatement) {
        CaseStatement cs = (CaseStatement)s ;
        Mark mark = marks.get(cs) ;
        l.add(new Nop(mark)) ;
      }
      else {
        newContext.compile(s,l) ;
      }
    }
    l.add(new Nop(theEnd)) ;
  }
View Full Code Here

    Var vret = (Var)newContext.getVar("$$ra$$") ;
    Mark the_end = new Mark() ;
    Mark start_pc = new Mark() ;
    Mark end_pc = new Mark() ;
    Mark handler = new Mark() ;
    l.add(new Nop(start_pc)) ;
    createTryCatch(newContext, statements, catchBlocks,l) ;
    l.add(new Nop(end_pc)) ;
    l.add(new JumpSub(finallyMark)) ;
    l.add(new Goto(the_end)) ;
    {
      l.add(new ExceptionHandler(start_pc,end_pc,handler,TypeName.THROWABLE)) ;
      l.add(new Nop(handler)) ;
      l.add(new Store(ex)) ;
      l.add(new JumpSub(finallyMark)) ;
      l.add(new Load(ex)) ;
      l.add(new Throw()) ;
    }
    l.add(new Nop(finallyMark)) ;
    l.add(new Store(vret)) ;
    for(Statement s: finallyStatements) {
      newContext.compile(s,l) ;
    }
    l.add(new ReturnVar(vret.index)) ;
    l.add(new Nop(the_end))
  }
View Full Code Here

TOP

Related Classes of org.allspice.bytecode.instructions.Nop

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.