Examples of BytecodeContext


Examples of railo.transformer.bytecode.BytecodeContext

    ClassWriter cw = ASMUtil.getClassWriter();
        //ClassWriter cw = new ClassWriter(true);
      cw.visit(Opcodes.V1_2, Opcodes.ACC_PUBLIC, real, null, "java/lang/Object", null);

      //GeneratorAdapter ga = new GeneratorAdapter(Opcodes.ACC_PUBLIC,Page.STATIC_CONSTRUCTOR,null,null,cw);
    BytecodeContext statConstr = null;//new BytecodeContext(null,null,null,cw,real,ga,Page.STATIC_CONSTRUCTOR);

      ///ga = new GeneratorAdapter(Opcodes.ACC_PUBLIC,Page.CONSTRUCTOR,null,null,cw);
    BytecodeContext constr = null;//new BytecodeContext(null,null,null,cw,real,ga,Page.CONSTRUCTOR);
   
     
     // field component
      //FieldVisitor fv = cw.visitField(Opcodes.ACC_PRIVATE, "c", "Lrailo/runtime/ComponentImpl;", null, null);
      //fv.visitEnd();
     
      java.util.List<LitString> _keys=new ArrayList<LitString>();
   
        // remote methods
        Collection.Key[] keys = component.keys(Component.ACCESS_REMOTE);
        int max;
        for(int i=0;i<keys.length;i++){
          max=-1;
          while((max=createMethod(statConstr,constr,_keys,cw,real,component.get(keys[i]),max, writeLog,supressWSbeforeArg))!=-1){
            break;// for overload remove this
          }
        }
       
        // Constructor
        GeneratorAdapter adapter = new GeneratorAdapter(Opcodes.ACC_PUBLIC,CONSTRUCTOR_OBJECT,null,null,cw);
    adapter.loadThis();
        adapter.invokeConstructor(Types.OBJECT, CONSTRUCTOR_OBJECT);
        railo.transformer.bytecode.Page.registerFields(new BytecodeContext(null,statConstr,constr,getPage(statConstr,constr),_keys,cw,real,adapter,CONSTRUCTOR_OBJECT,writeLog,supressWSbeforeArg), _keys);
        adapter.returnValue();
        adapter.endMethod();
       
       
        cw.visitEnd();
View Full Code Here

Examples of railo.transformer.bytecode.BytecodeContext

                udf.getFunctionName(),
                rtnType,
              types
                );
            GeneratorAdapter adapter = new GeneratorAdapter(Opcodes.ACC_PUBLIC+Opcodes.ACC_FINAL , method, null, null, cw);
            BytecodeContext bc = new BytecodeContext(null,statConstr,constr,getPage(statConstr,constr),keys,cw,className,adapter,method,writeLog,supressWSbeforeArg);
            Label start=adapter.newLabel();
            adapter.visitLabel(start);
           
       //ComponentController.invoke(name, args);
            // name
            adapter.push(udf.getFunctionName());
           
            // args
            ArrayVisitor av=new ArrayVisitor();
            av.visitBegin(adapter,Types.OBJECT,types.length);
            for(int y=0;y<types.length;y++){
          av.visitBeginItem(adapter, y);
            adapter.loadArg(y);
          av.visitEndItem(bc.getAdapter());
            }
            av.visitEnd();
            adapter.invokeStatic(COMPONENT_CONTROLLER, INVOKE);
            adapter.checkCast(rtnType);
           
View Full Code Here

Examples of railo.transformer.bytecode.BytecodeContext

 
  public abstract void _writeOut(BytecodeContext bc, int pageType) throws BytecodeException;
 

  public final void loadUDFProperties(BytecodeContext bc, int valueIndex,int arrayIndex, boolean closure) throws BytecodeException {
    BytecodeContext constr = bc.getConstructor();
    GeneratorAdapter cga = constr.getAdapter();
    GeneratorAdapter ga = bc.getAdapter();
   
    // store
    cga.visitVarInsn(ALOAD, 0);
    cga.visitFieldInsn(GETFIELD, bc.getClassName(), "udfs", Types.UDF_PROPERTIES_ARRAY.toString());
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.core.BytecodeContext

    return context;
  }

  @Override
  public BytecodeContext visit(ClassDef classDef) {
    BytecodeContext newContext = new BytecodeContextImpl(evalContext);
    List<Definition> classDefs = classDef.getClassDefinitions();
    List<Definition> defs = classDef.getDefinitions();
    for(Definition def : classDefs) {
      newContext = def.accept(new BytecodeDefVisitor(newContext));
    }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.core.BytecodeContext

    return inner.accept(new BytecodeOperandVisitor(context));
  }

  @Override
  public BytecodeValue visit(New aNew) {
    BytecodeContext newContext;
    List<Definition> defs = aNew.getDefs();
    BytecodeValue thisObject = context.getValue("this").dereference();
    BytecodeClass newClass;
    if(thisObject != null) {
      BytecodeClassDef thisClass = (BytecodeClassDef) thisObject;
      newContext = new BytecodeContextImpl(thisClass.getContext());
      newClass = (BytecodeClass) thisClass.getCompleteClass();
    } else {
      newContext = context;
      newClass = new BytecodeClass(newContext);
    }
    BytecodeContext tempContext = new BytecodeContextImpl(context);
    for(Definition def : defs) {
      def.accept(new BytecodeDefVisitor(newClass.getContext(),tempContext));
    }
    return newClass;
  }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.core.BytecodeContext

   * and returns it
   * @return
   *     a bytecodeClass representing the full class instance
   */
  public BytecodeValue getCompleteClass() { 
    BytecodeContext context = new BytecodeContextImpl(coreContext);
    BytecodeFunction init = (BytecodeFunction) context.getValue("$init");
    init.run(new ArrayList<BytecodeValue>(), context);
    for(Definition def : defs) {
      context = def.accept(new BytecodeDefVisitor(context));
    }
    return new BytecodeClass(context);
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.core.BytecodeContext

   * @param args
   *            the arguments associated with the call to the function
   * @return the final result of the function's execution
   */
  public BytecodeValue run(List<BytecodeValue> args) {
    BytecodeContext context = new BytecodeContextImpl(coreContext);
    return run(args,context);
  }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.core.BytecodeContext

    BytecodeContext context = new BytecodeContextImpl(coreContext);
    return run(args,context);
  }
 
  public BytecodeValue run(List<BytecodeValue> args, BytecodeContext ctx) {
    BytecodeContext context;
    if(isInit) {
      context = ctx;
    } else {
      context = new BytecodeContextImpl(coreContext);
    }
    for (int i = 0; i < args.size(); i++) {
      BytecodeValue val = args.get(i);
      String name = params.get(i);
      context.addToContext(name, val);
    }
    Interpreter interperter = new Interpreter(body, context);
    BytecodeValue res = interperter.execute();
    return res;
  }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.interpreter.core.BytecodeContext

   *     expected values for the names
   * @return
   *     whether all the name/value pairs have been found correctly
   */
  public boolean isInContext(String[] names, BytecodeValue[] vals) {
    BytecodeContext context = interperter.getCurrentContext();
    for(int i = 0 ; i < names.length ; i++) {
      try {
        BytecodeValue val = context.getValue(names[i]).dereference();
        if(val instanceof BytecodeFunction) {
          if(vals[i] instanceof BytecodeFunction) {
            continue;
          } else {
            return false;
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.