Package wyvern.targets.Common.wyvernIL.interpreter.values

Examples of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeRef


   * dest will always be an Immediate with VarRef or an Inv
   */
  @Override
  public BytecodeContext visit(Assign assign) {
    Expression destExpr = assign.getDest();
    BytecodeRef dest;
    if(destExpr instanceof Inv) {
      Inv inv = (Inv) destExpr;
      BytecodeOperandVisitor opVisitor = new BytecodeOperandVisitor(context);
      BytecodeClass clas = (BytecodeClass) inv.getSource().accept(opVisitor);
      BytecodeValue val = clas.getContext().getValue(inv.getId());
      dest = (BytecodeRef) val;
    } else if(destExpr instanceof Immediate) {
      Immediate imm = (Immediate) destExpr;
      VarRef ref = (VarRef) imm.getInner();
      dest = (BytecodeRef) context.getValue(ref.getName());
    } else {
      throw new RuntimeException("assignment not using Inv or Imm");
    }
    BytecodeValue src = assign.getSrc().accept(visitor);
    dest.setValue(src);
    return context;
  }
View Full Code Here


    return sb.toString();
  }

  @Override
  public void setThis(BytecodeValue thisClass) {
    BytecodeRef ref = (BytecodeRef) context.get("this");
    ref.setValue(thisClass);
  }
View Full Code Here

TOP

Related Classes of wyvern.targets.Common.wyvernIL.interpreter.values.BytecodeRef

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.