Package org.xmlvm.refcount

Examples of org.xmlvm.refcount.InstructionUseInfo


    RegisterSet allRegs= new RegisterSet();
    for (CodePath curPath : allCodePaths)
    {
      for (OnePathInstructionRegisterContents curInst : curPath.path)
      {
        InstructionUseInfo useInfo= beenTo.get(curInst.instruction).useInfo;
        allRegs.orEq(useInfo.allWrites());
        allRegs.orEq(useInfo.usedReg());
      }
    }

    // Emit decl for each register
    for (int regId : allRegs)
    {
      Element initElem= new Element(InstructionProcessor.cmd_define_register, InstructionProcessor.vm);
      initElem.setAttribute("vartype", InstructionProcessor.cmd_define_register_attr_register);
      initElem.setAttribute("num", regId + "");
      toRet.functionInit.add(initElem);
    }

    // Find all the var elements, and add moves for them
    int argIdx= 1;
    for (Element curElem : (List<Element>) codeElement.getChildren())
    {
      if (curElem.getName().equals("var"))
      {
        Element moveArg= new Element(InstructionProcessor.cmd_move_argument, InstructionProcessor.vm);
        moveArg.setAttribute("vx", curElem.getAttributeValue("register"));
        moveArg.setAttribute("vx-type", curElem.getAttributeValue("type"));

        String sourceName= curElem.getAttributeValue("name");
        if (sourceName == "this")
        {
          moveArg.setAttribute("sourceArg", "self");
        }
        else
        {
          moveArg.setAttribute("sourceArg", argIdx + "");
          argIdx++;
        }
        toRet.functionInit.add(moveArg);
        allRegs.remove(curElem.getAttribute("register").getIntValue());

      }
    }

    RegisterSet hasObj= RegisterSet.none();
    for (CodePath curPath : allCodePaths)
    {
      // collect non obj writes
      for (OnePathInstructionRegisterContents curInst : curPath.path)
      {
        InstructionUseInfo useInfo= beenTo.get(curInst.instruction).useInfo;
        hasObj.orEq(useInfo.writesObj());
      }
    }

    allRegs.andEq(hasObj);
View Full Code Here


    for (CodePath c : allCodePaths)
    {
      RegisterSet allRegs= new RegisterSet();
      for (OnePathInstructionRegisterContents curInst : c.path)
      {
        InstructionUseInfo useInfo= beenTo.get(curInst.instruction).useInfo;
        allRegs.orEq(useInfo.allWrites());
        allRegs.orEq(useInfo.usedReg());
      }

      // Look for a retain, no writes, then a release, and then get
      // rid of the symmetric retain / release
View Full Code Here

    RegisterSet allRegs= new RegisterSet();
    for (CodePath curPath : allCodePaths)
    {
      for (OnePathInstructionRegisterContents curInst : curPath.path)
      {
        InstructionUseInfo useInfo= beenTo.get(curInst.instruction).useInfo;
        allRegs.orEq(useInfo.allWrites());
        allRegs.orEq(useInfo.usedReg());
      }
    }

    for (CodePath c : allCodePaths)
    {
View Full Code Here

TOP

Related Classes of org.xmlvm.refcount.InstructionUseInfo

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.