Examples of Dup


Examples of org.allspice.bytecode.instructions.Dup

      final Expr lhs = t.lhs;
      final Expr rhs = t.rhs;
      StubResolver type = getType(t,context) ;
      if (type.getTypeName().equals(TypeName.STRING)) {
        l.add(new New(TypeName.STRINGBUILDER)) ;
        l.add(new Dup(TypeCode.VOID,TypeCode.OBJECT)) ;
        l.add(new InvokeSpecial(new MethodRef(TypeName.STRINGBUILDER,TypeName.VOID,"<init>"))) ;
        context.compile(TypeName.OBJECT, lhs, l) ;
        l.add(new InvokeVirtual(new MethodRef(TypeName.STRINGBUILDER,TypeName.STRINGBUILDER,"append",TypeName.OBJECT))) ;
        context.compile(TypeName.OBJECT, rhs, l) ;
        l.add(new InvokeVirtual(new MethodRef(TypeName.STRINGBUILDER,TypeName.STRINGBUILDER,"append",TypeName.OBJECT))) ;
View Full Code Here

Examples of org.allspice.bytecode.instructions.Dup

    l.add(new Increment(v,inc)) ;
  }

  public static LValue createInc(EvaluationContext context,Expr e,Number inc,InstList l) throws CompilerException {
    LValue v = context.compileLValue(e, l) ;
    l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
    l.add(new Increment(v,inc)) ;
    return v ;
  }
View Full Code Here

Examples of org.allspice.bytecode.instructions.Dup

    LValue v = context.compileLValue(e, l) ;
    if (TypeCode.getType(forwardType) == TypeCode.VOID) {
      l.add(new Increment(v,inc)) ;
    }
    else {
      l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
      l.add(new Load(v)) ;
      final TypeCode tc = TypeCode.getType(v.getType());
      l.add(new Dup(v.getRefType(),tc)) ;
      l.add(new Pop(tc)) ;
      l.add(new Increment(v,inc)) ;
      convert(context,context.getType(e),forwardType,l) ;
    }
  }
View Full Code Here

Examples of org.allspice.bytecode.instructions.Dup

    }
  }
 
  public static LValue createSetValueExpr(EvaluationContext context,Expr lhs,Expr e,InstList l) throws CompilerException {
    LValue v = context.compileLValue(lhs, l);
    l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
    makeInit(context,e,v.getType(),l) ;
    l.add(new Store(v)) ;
    return v ;
  }
View Full Code Here

Examples of org.allspice.bytecode.instructions.Dup

  }

  public static void createNew(EvaluationContext context, final String type, final Collection<Expr> args, InstList l) throws CompilerException {
    TypeName fqtype = context.fullyQualified(type) ;
    l.add(new New(fqtype)) ;
    l.add(new Dup(TypeCode.VOID,TypeCode.getType(type))) ;
    MethodStub fd = context.getMethod(context.makeTypeRef(fqtype), "<init>", args) ;
    if (fd == null) {
      throw new UndefinedMethod("<init>") ;
    }
    MethodRef mref = createMethodRef(fd) ;
View Full Code Here

Examples of org.allspice.bytecode.instructions.Dup

    }
  }

  public static void createInPlaceNoReturn(EvaluationContext context, Expr inc, final Expr var, final Inst inst,InstList l ) throws CompilerException {
    LValue v = context.compileLValue(var, l);
    l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
    l.add(new Load(v)) ;
    createConvert(context, inc, v.getType(),l) ;
    l.add(inst) ;
    l.add(new Store(v)) ;
  }
View Full Code Here

Examples of org.allspice.bytecode.instructions.Dup

    l.add(new Store(v)) ;
  }

  public static LValue createInPlace(EvaluationContext context, Expr inc, final Expr var, final Inst inst,InstList l ) throws CompilerException {
    LValue v = context.compileLValue(var, l);
    l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
    l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
    l.add(new Load(v)) ;
    createConvert(context, inc, v.getType(),l) ;
    l.add(inst) ;
    l.add(new Store(v)) ;
    return v ;
View Full Code Here

Examples of org.apache.bcel.generic.DUP

            InstructionHandle[] match = (InstructionHandle[])iter.next();
            try {
          org.apache.bcel.generic.Instruction iload;
                org.apache.bcel.generic.Instruction aload;
                if ((!match[0].hasTargeters()) && (!match[1].hasTargeters())) {
                    il.insert(match[1], new DUP());
                    il.delete(match[1]);
                }
            }
            catch (TargetLostException e) {
                // TODO: move target down into the list
View Full Code Here

Examples of org.apache.bcel.generic.DUP

                        (org.apache.bcel.generic.ALOAD) match[0].getInstruction();
                    org.apache.bcel.generic.ALOAD aload2 =
                        (org.apache.bcel.generic.ALOAD) match[1].getInstruction();
                   
                    if (aload1.getIndex() == aload2.getIndex()) {
                        il.insert(match[1], new DUP());
                        il.delete(match[1]);
                    }
                }
            }
            catch (TargetLostException e) {
View Full Code Here

Examples of org.apache.bcel.generic.DUP

                        (org.apache.bcel.generic.ALOAD) match[0].getInstruction();
                    org.apache.bcel.generic.ALOAD aload2 =
                        (org.apache.bcel.generic.ALOAD) match[1].getInstruction();
                   
                    if (aload1.getIndex() == aload2.getIndex()) {
                        il.insert(match[1], new DUP());
                        il.delete(match[1]);
                    }
                }
            }
            catch (TargetLostException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.