Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.ACONST_NULL


    (_type instanceof BooleanType))
    il.append(new ICONST(0)); // 0 for node-id, integer and boolean
      else if (_type instanceof RealType)
    il.append(new DCONST(0)); // 0.0 for floating point numbers
      else
    il.append(new ACONST_NULL()); // and 'null' for anything else

            // Mark the store as the start of the live range of the variable
            _local.setStart(il.append(_type.STORE(_local.getIndex())));
  }
    }
View Full Code Here


           Util.getJCRefType(Constants.NODE_ITERATOR_SIG),
           null, null);
  ITERATOR_INDEX = iterator.getIndex();
  _aloadIterator = new ALOAD(ITERATOR_INDEX);
  _astoreIterator = new ASTORE(ITERATOR_INDEX);
  il.append(new ACONST_NULL());
  il.append(storeIterator());
    }
View Full Code Here

           Util.getJCRefType(Constants.NODE_ITERATOR_SIG),
           null, null);
  ITERATOR_INDEX = iterator.getIndex();
  _aloadIterator = new ALOAD(ITERATOR_INDEX);
  _astoreIterator = new ASTORE(ITERATOR_INDEX);
  il.append(new ACONST_NULL());
  il.append(storeIterator());
    }
View Full Code Here

    (_type instanceof BooleanType))
    il.append(new ICONST(0)); // 0 for node-id, integer and boolean
      else if (_type instanceof RealType)
    il.append(new DCONST(0)); // 0.0 for floating point numbers
      else
    il.append(new ACONST_NULL()); // and 'null' for anything else
      il.append(_type.STORE(_local.getIndex()));
  }
    }
View Full Code Here

    (_type instanceof BooleanType))
    il.append(new ICONST(0)); // 0 for node-id, integer and boolean
      else if (_type instanceof RealType)
    il.append(new DCONST(0)); // 0.0 for floating point numbers
      else
    il.append(new ACONST_NULL()); // and 'null' for anything else
      il.append(_type.STORE(_local.getIndex()));
  }
    }
View Full Code Here

                    type = Type.INT;
                }
                insList.append(insFactory.createInvoke(STACK_CLASS, getPopMethod(type), type, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
                insList.append(InstructionFactory.createStore(type, i));
            } else if (type == null) {
                insList.append(new ACONST_NULL());
                insList.append(InstructionFactory.createStore(new ObjectType("<null object>"), i));
            } else if (type instanceof UninitializedObjectType) {
                // No uninitilaized objects should be found
                // in the local variables.
            } else if (type instanceof ReferenceType) {
                insList.append(InstructionFactory.createLoad(STACK_TYPE, method.getMaxLocals()+1));
                insList.append(insFactory.createInvoke(STACK_CLASS, getPopMethod(Type.OBJECT), Type.OBJECT, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
                if (!type.equals(Type.OBJECT) && (!type.equals(Type.NULL))) {
                    insList.append(insFactory.createCast(Type.OBJECT, type));
                }
                insList.append(InstructionFactory.createStore(type, i));
            }
        }

        InvokeInstruction inv = (InvokeInstruction) handle.getInstruction();
        Type returnType = getReturnType(method.getConstantPool().getConstantPool(), inv.getIndex());
        boolean skipFirst = returnType.getSize() > 0;

        // restore stack
        OperandStack os = frame.getStack();
        for (int i = os.size() - 1; i >= (skipFirst ? 1 : 0); i--) {
            Type type = os.peek(i);
            if (type instanceof BasicType) {
                if (type.getSize() < 2 && !type.equals(Type.FLOAT)) {
                    type = Type.INT;
                }
                insList.append(InstructionFactory.createLoad(STACK_TYPE, method.getMaxLocals()+1));
                insList.append(insFactory.createInvoke(STACK_CLASS, getPopMethod(type), type, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
            } else if (type == null) {
                insList.append(new ACONST_NULL());
            } else if (type instanceof UninitializedObjectType) {
                // After the remove of new, there shouldn't be a
                // uninitialized object on the stack
            } else if (type instanceof ReferenceType) {
                insList.append(InstructionFactory.createLoad(STACK_TYPE, method.getMaxLocals()+1));
View Full Code Here

            else if (returnTypeClass == Long.TYPE) {
                instruction = basicTypeTranslation(Long.class, Long.TYPE,
                                                   "getLong", instructionFactory);
            }
            else if (returnTypeClass == Void.TYPE) {
                instruction = new ACONST_NULL();
            }
            Assert.that(instruction != null,
                "unsupported primtive return type encountered: %s", returnTypeClass);
            instructionList.append(instruction);
        }
View Full Code Here

           Util.getJCRefType(Constants.NODE_ITERATOR_SIG),
           null, null);
  ITERATOR_INDEX = iterator.getIndex();
  _aloadIterator = new ALOAD(ITERATOR_INDEX);
  _astoreIterator = new ASTORE(ITERATOR_INDEX);
  il.append(new ACONST_NULL());
  il.append(storeIterator());
    }
View Full Code Here

            case Constants.T_LONG:
                patch.append(new LCONST(0));
                patch.append(new LRETURN());
            break;
            default:
                patch.append(new ACONST_NULL());
                patch.append(new ARETURN());
        }
        mg.stripAttributes(true);
        mg.setInstructionList(patch);
        mg.removeExceptionHandlers();
View Full Code Here

    (_type instanceof BooleanType))
    il.append(new ICONST(0)); // 0 for node-id, integer and boolean
      else if (_type instanceof RealType)
    il.append(new DCONST(0)); // 0.0 for floating point numbers
      else
    il.append(new ACONST_NULL()); // and 'null' for anything else
      il.append(_type.STORE(_local.getIndex()));
  }
    }
View Full Code Here

TOP

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

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.