Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.IFEQ


      // If not we have to check to see if the copy will result in an
      // element being output.
      else {
    // check if element; if not skip to translate body
    il.append(new ILOAD(length.getIndex()));
    final BranchHandle ifBlock2 = il.append(new IFEQ(null));
    // length != 0 -> element -> do attribute sets
    _useSets.translate(classGen, methodGen);
    // not an element; root
    ifBlock2.setTarget(il.append(NOP));
      }
  }

  // Instantiate body of xsl:copy
  translateContents(classGen, methodGen);

  // Call the output handler's endElement() if we copied an element
  // (The DOM.shallowCopy() method calls startElement().)
  il.append(new ILOAD(length.getIndex()));
  final BranchHandle ifBlock3 = il.append(new IFEQ(null));
  il.append(methodGen.loadHandler());
  il.append(new ALOAD(name.getIndex()));
  il.append(methodGen.endElement());
 
  final InstructionHandle end = il.append(NOP);
View Full Code Here


  final InstructionList il = methodGen.getInstructionList();
  translate(classGen, methodGen);

  if ((type instanceof BooleanType) || (type instanceof IntType)) {
      _falseList.add(il.append(new IFEQ(null)));
  }
    }
View Full Code Here

  il.append(methodGen.loadDOM());
  il.append(methodGen.loadCurrentNode());
  il.append(new INVOKEINTERFACE(gname, 2));
  // Compare the two strings
  il.append(new INVOKEVIRTUAL(cmp));
  _falseList.add(il.append(new IFEQ(null)));
   
  // Compile the expressions within the predicates
  if (hasPredicates()) {
      final int n = _predicates.size();
      for (int i = 0; i < n; i++) {
View Full Code Here

  il.append(new DSTORE(local.getIndex()));

  // Compare it to 0.0
  il.append(DCONST_0);
  il.append(DCMPG);
  flowlist.add(il.append(new IFEQ(null)));

  //!!! call isNaN
  // Compare it to itself to see if NaN
  il.append(new DLOAD(local.getIndex()));
  il.append(new DLOAD(local.getIndex()));
View Full Code Here

    public FlowList translateToDesynthesized(ClassGenerator classGen,
               MethodGenerator methodGen,
               BooleanType type) {
  InstructionList il = methodGen.getInstructionList();
  translateTo(classGen, methodGen, type);
  return new FlowList(il.append(new IFEQ(null)));
    }
View Full Code Here

  final InstructionList il = methodGen.getInstructionList();
  translate(classGen, methodGen);

  if ((type instanceof BooleanType) || (type instanceof IntType)) {
      _falseList.add(il.append(new IFEQ(null)));
  }
    }
View Full Code Here

      // If not we have to check to see if the copy will result in an
      // element being output.
      else {
    // check if element; if not skip to translate body
    il.append(new ILOAD(length.getIndex()));
    final BranchHandle ifBlock2 = il.append(new IFEQ(null));
    // length != 0 -> element -> do attribute sets
    _useSets.translate(classGen, methodGen);
    // not an element; root
    ifBlock2.setTarget(il.append(NOP));
      }
  }

  // Instantiate body of xsl:copy
  translateContents(classGen, methodGen);

  // Call the output handler's endElement() if we copied an element
  // (The DOM.shallowCopy() method calls startElement().)
  il.append(new ILOAD(length.getIndex()));
  final BranchHandle ifBlock3 = il.append(new IFEQ(null));
  il.append(methodGen.loadHandler());
  il.append(new ALOAD(name.getIndex()));
  il.append(methodGen.endElement());
 
  final InstructionHandle end = il.append(NOP);
View Full Code Here

      if (test instanceof FunctionCall) {
    FunctionCall call = (FunctionCall)test;
    try {
        Type type = call.typeCheck(getParser().getSymbolTable());
        if (type != Type.Boolean) {
      test._falseList.add(il.append(new IFEQ(null)));
        }
    }
    catch (TypeCheckError e) {
        // handled later!
    }
View Full Code Here

        InstructionHandle defaultHandle;

        // (flag == 0)
        il.append(InstructionConstants.ALOAD_0);
        il.append(factory.createGetField(className, ClassEnhancer.FN_Flag, Type.BYTE));
        BranchInstruction flgIsZero = new IFEQ(null);
        il.append(flgIsZero);

        // (sm == null)
        il.append(InstructionConstants.ALOAD_0);
        il.append(factory.createGetField(className, ClassEnhancer.FN_StateManager, BCELClassEnhancer.OT_StateManager));
        BranchInstruction smIsNull = new IFNULL(null);
        il.append(smIsNull);

        // jdoStateManager
        il.append(InstructionConstants.ALOAD_0);
        il.append(factory.createGetField(className, ClassEnhancer.FN_StateManager, BCELClassEnhancer.OT_StateManager));

        il.append(InstructionConstants.ALOAD_0);
        // the field index: 0, 1, 2...
        il.append(BCELUtils.getBIPUSH(fieldConfig.getFieldId()));
        if (cmd.getPersistenceCapableSuperclass() != null)
        {
            //add to field index the parentFieldCount
            il.append(factory.createGetStatic(className, ClassEnhancer.FN_JdoInheritedFieldCount, Type.INT));
            il.append(InstructionConstants.IADD);
        }
        // objPC.field
        il.append(InstructionConstants.ALOAD_0);
        il.append(factory.createGetField(className, fieldName, nativeType));

        // the value in parameter to set
        il.append(InstructionFactory.createLoad(nativeType, 1));

        // objPC.setXXXField
        il.append(factory.createInvoke(ClassEnhancer.CN_StateManager, "set" + BCELUtils.getJDOMethodName(smType) + "Field",
            Type.VOID, new Type[]{BCELClassEnhancer.OT_PersistenceCapable, Type.INT, smType, smType}, Constants.INVOKEINTERFACE));
        il.append(InstructionConstants.RETURN);

        // he value in parameter to set
        defaultHandle = il.append(InstructionConstants.ALOAD_0);
        il.append(InstructionFactory.createLoad(nativeType, 1));
        // objPC.field =
        il.append(factory.createPutField(className, targetField.getName(), nativeType));

        //----detach------
        if (cmd.isDetachable())
        {
            // jdoIsDetached()
            il.append(InstructionConstants.ALOAD_0);
            il.append(factory.createInvoke(ClassEnhancer.CN_PersistenceCapable, ClassEnhancer.MN_JdoIsDetached,
                Type.BOOLEAN, Type.NO_ARGS, Constants.INVOKEINTERFACE));

            //1
            il.append(InstructionConstants.ICONST_1);
            // if (jdoIsDetached() == 1)
            IF_ICMPEQ ifIsDetached = new IF_ICMPEQ(null);
            il.append(ifIsDetached);
            //return;
            il.append(InstructionConstants.RETURN);

            // jdoDetachedState[3].set(?)
            //   jdoDetachedState[3]
            ifIsDetached.setTarget(il.append(InstructionConstants.ALOAD_0));
            il.append(factory.createGetField(className, ClassEnhancer.FN_JdoDetachedState, BCELClassEnhancer.OT_ObjectArray));
            il.append(InstructionConstants.ICONST_3);
            il.append(InstructionConstants.AALOAD);
            il.append(factory.createCheckCast(BCELClassEnhancer.OT_BitSet)); // Cast to BitSet

            //  the field index: 0, 1, 2...
            il.append(BCELUtils.getBIPUSH(fieldConfig.getFieldId()));
            if (cmd.getPersistenceCapableSuperclass() != null)
            {
                //add to field index the parentFieldCount
                il.append(factory.createGetStatic(className, ClassEnhancer.FN_JdoInheritedFieldCount, Type.INT));
                il.append(InstructionConstants.IADD);
            }
            //  set(?)
            il.append(factory.createInvoke(ClassEnhancer.CN_BitSet, "set", Type.VOID, new Type[]{Type.INT}, Constants.INVOKEVIRTUAL));
        }
        //----detach------

        il.append(InstructionConstants.RETURN);

        flgIsZero.setTarget(defaultHandle);
        smIsNull.setTarget(defaultHandle);
    }
View Full Code Here

        BranchInstruction jump1 = null;
        if( (fieldConfig.getJdoFieldFlag() & PersistenceCapable.CHECK_READ) == PersistenceCapable.CHECK_READ)
        {
            il.append(InstructionConstants.ALOAD_0);
            il.append(factory.createGetField(className, ClassEnhancer.FN_Flag, Type.BYTE));
            jump1 = new IFEQ(null);
            il.append(jump1);
        }

        il.append(InstructionConstants.ALOAD_0);
        il.append(factory.createGetField(className, ClassEnhancer.FN_StateManager, BCELClassEnhancer.OT_StateManager));
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.IFEQ

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.