Package org.trifort.rootbeer.generate.opencl

Examples of org.trifort.rootbeer.generate.opencl.OpenCLClass


    String synch = getVarName();
    String count = getVarName();
    String old = getVarName();
    m_oldValueFromMonitorStack.push(old);
   
    OpenCLClass ocl_class = OpenCLScene.v().getOpenCLClass(m_sootMethod.getDeclaringClass());
    OpenCLMethod ocl_method = ocl_class.getMethod(m_sootMethod.getSignature());
   
    m_output.append("int "+id+" = getThreadId();\n");
    m_output.append("char * "+mem+" = org_trifort_gc_deref(");
    arg0.getOp().apply(m_valueSwitch);
    m_output.append(");\n");
View Full Code Here


    name_array[0] = Character.toUpperCase(name_array[0]);
    return new String(name_array);
  }
 
  protected List<OpenCLField> getNonRefFields(SootClass soot_class){
    OpenCLClass ocl_class = OpenCLScene.v().getOpenCLClass(soot_class);
    return ocl_class.getInstanceNonRefFields();
  }
View Full Code Here

    OpenCLClass ocl_class = OpenCLScene.v().getOpenCLClass(soot_class);
    return ocl_class.getInstanceNonRefFields();
  }

  protected List<OpenCLField> getRefFields(SootClass soot_class){
    OpenCLClass ocl_class = OpenCLScene.v().getOpenCLClass(soot_class);
    if(ocl_class == null){
      System.out.println("ocl_class == null: "+soot_class.getName());
    }
    return ocl_class.getInstanceRefFields();
  }
View Full Code Here

      m_bcl.top().mult(element_size, length);
      m_bcl.top().plus(size, element_size);
      m_bcl.top().returnValue(size);
    }else if(type instanceof RefType) {
      RefType rtype = (RefType) type;
      OpenCLClass ocl_class = OpenCLScene.v().getOpenCLClass(rtype.getSootClass());
      int size = ocl_class.getSize();
      m_bcl.top().returnValue(IntConstant.v(size));
    }
    m_bcl.top().label(label);
   
  }
View Full Code Here

    int class_id = RootbeerClassLoader.v().getClassNumber(type.toString());
    SootClass soot_class = type.getSootClass();
   
    Local object_to_write_from = bcl.cast(type, m_Param0);
   
    OpenCLClass ocl_class = OpenCLScene.v().getOpenCLClass(soot_class);
    int size = ocl_class.getSize();
    int gc_count = ocl_class.getRefFieldsSize();
   
    bcl_mem.writeByte((byte) gc_count);      //ref_type count [0]
    bcl_mem.writeByte((byte) 0);             //garabage collector color [1]
    bcl_mem.writeByte((byte) 0);             //reserved [2]
    bcl_mem.writeByte((byte) 0);             //ctor used [3]
View Full Code Here

  }
 
  private void determineConstructorInfo(){
    SootMethod soot_method = m_body.getMethod();
    SootClass soot_class = soot_method.getDeclaringClass();
    OpenCLClass ocl_class = OpenCLScene.v().getOpenCLClass(soot_class);

    m_allocSize = ocl_class.getSize();
    m_refFieldsSize = ocl_class.getRefFieldsSize();
    m_derivedType = OpenCLScene.v().getClassType(soot_class);
  }
View Full Code Here

      ret.append(field.getInstanceSetterInvokeWithoutThisref()+"thisref, 0, exception);\n");
    }  
  }
 
  private List<OpenCLField> getFields(SootClass soot_class, boolean ref_fields){
    OpenCLClass ocl_class = OpenCLScene.v().getOpenCLClass(soot_class)
    if(ref_fields)
      return ocl_class.getInstanceRefFields();
    else
      return ocl_class.getInstanceNonRefFields();
  }
View Full Code Here

      if(root_class.isInterface()){
        continue;
      }
     
      OpenCLClass ocl_class = OpenCLScene.v().getOpenCLClass(root_class);
      TreeNode tree_node = new TreeNode(root_class, ocl_class);
     
      LinkedList<TreeNode> queue = new LinkedList<TreeNode>();
      queue.add(tree_node);
      all_tree_nodes.add(tree_node);
     
      while(queue.isEmpty() == false){
        TreeNode curr = queue.removeFirst();
        SootClass soot_class = curr.getSootClass();
        int num = StringNumbers.v().addString(soot_class.getName());
       
        Set<Integer> children = hgraph.getChildren(num);
        for(Integer child : children){
          String child_str = StringNumbers.v().getString(child);
          SootClass child_class = Scene.v().getSootClass(child_str);
          if(child_class.isInterface()){
            continue;
          }
          if(dfs_string_types.contains(child_str) == false){
            continue;
          }
          OpenCLClass ocl_class2 = OpenCLScene.v().getOpenCLClass(child_class);
          TreeNode child_node = new TreeNode(child_class, ocl_class2);
          curr.addChild(child_node);
          queue.add(child_node);
        }
      }
View Full Code Here

    // Force fields to be generated
    FieldSignatureUtil util = new FieldSignatureUtil();
    ForcedFields forced_fields = new ForcedFields();
    for(String field_sig : forced_fields.get()){
      util.parse(field_sig);
      OpenCLClass field_class = classes.get(util.getDeclaringClass());
      OpenCLField field = field_class.getField(util.getName());
      String prototype = field.getGetterSetterPrototypes();
      if (!set.contains(prototype)) {
        set.add(prototype);
        m_fieldsToForce.add(field_sig);
      }
View Full Code Here

    }
    // Force fields to be generated
    FieldSignatureUtil util = new FieldSignatureUtil();
    for(String field_sig : m_fieldsToForce){
      util.parse(field_sig);
      OpenCLClass field_class = classes.get(util.getDeclaringClass());
      OpenCLField field = field_class.getField(util.getName());
      CompositeField composite = new CompositeField();
      SootField soot_field = util.getSootField();
      if(soot_field.getType() instanceof RefType){
        composite.addRefField(field, soot_field.getDeclaringClass());
      } else {
View Full Code Here

TOP

Related Classes of org.trifort.rootbeer.generate.opencl.OpenCLClass

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.