Package org.allspice.bytecode

Examples of org.allspice.bytecode.Var


   */
  public static void createStore(InstructionListContext ilc, LValue lval) {
    TypeCode type = TypeCode.getType(lval.getType()) ;
    switch(lval.getLValueType()) {
    case local: {
      Var var = (Var)lval ;
      createStore(type, var.index,ilc) ;
      break ;
    }
    case array: {
      createArrayStore(type,ilc) ;
View Full Code Here


   */
  public static void createLoad(InstructionListContext ilc, LValue lval) {
    TypeCode type = TypeCode.getType(lval.getType()) ;
    switch(lval.getLValueType()) {
    case local: {
      Var var = (Var)lval;
      createLoad(type, var.index,ilc) ;
      break ;
    }
    case array: {
      createArrayLoad(type,ilc) ;
View Full Code Here

    VarStack vs = this ;
    for(VarDecl varDecl: varDecls) {
      String t = varDecl.type ;
      TypeCode type = TypeCode.getType(t) ;
      TypeName fqtype = fuinfo.getFullQualified(t) ;
      vs = new VarStack(vs.nextVar + type.wordSize,vs.decls.insert(varDecl.name, new Var(vs.nextVar,fqtype))) ;
    }
    return vs ;
  }
View Full Code Here

    }
    return vs ;
  }
  public VarStack addThis(StubResolver resolver) throws CompilerException {
    ClassStub stub = resolver.getStub() ;
    return new VarStack(1,decls.insert("this",new Var(0,resolver.getTypeName())).insert("super",new Var(0,stub.superClass.getTypeName()))) ;
  }
View Full Code Here

import org.allspice.bytecode.instructions.ShiftLeft;

public class TestSHL extends MyTestCase {
  public ClassDef defadd(String ret,String type,int i1,int i2) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    Var y = new Var(i2,TypeName.INT) ;
    MethodDef md = new MethodDef(new TypeName(ret),"meth",x,y) ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new ShiftLeft(TypeCode.getType(type)),
View Full Code Here

import org.allspice.bytecode.instructions.Return;

public class TestIFLT extends MyTestCase {
  public ClassDef defadd(String type,int i1,int i2) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    Var y = new Var(i2,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x,y) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
View Full Code Here

import org.allspice.bytecode.instructions.ShiftRight;

public class TestSHR extends MyTestCase {
  public ClassDef defadd(String ret,String type,int i1,int i2) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    Var y = new Var(i2,TypeName.INT) ;
    MethodDef md = new MethodDef(new TypeName(ret),"meth",x,y) ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new ShiftRight(TypeCode.getType(type)),
View Full Code Here

import org.allspice.bytecode.instructions.Return;

public class TestIFNE0 extends MyTestCase {
  public ClassDef defadd(String type,int i1) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfNotEquals0(TypeCode.getType(type),one),
View Full Code Here

import org.allspice.bytecode.instructions.Return;

public class TestIncrement extends MyTestCase {
  public ClassDef defadd(String type,Number inc) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(1,new TypeName(type)) ;
    MethodDef md = new MethodDef(new TypeName(type),"meth",x) ;
    md = md.addInstructions(
        new Increment(x,inc),
        new Load(x),
        new Return(TypeCode.getType(type))
View Full Code Here

public class TestPop extends MyTestCase {
  public ClassDef defadd01() {
    ClassDef cd = makeClassDef() ;
    {
      Var x = new Var(0,TypeName.INT) ;
      Var y = new Var(1,TypeName.INT) ;
      MethodDef md = new MethodDef(TypeName.INT,"getFoo",x,y) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Load(y),
View Full Code Here

TOP

Related Classes of org.allspice.bytecode.Var

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.