本文整理汇总了Java中org.apache.bcel.generic.NEWARRAY类的典型用法代码示例。如果您正苦于以下问题:Java NEWARRAY类的具体用法?Java NEWARRAY怎么用?Java NEWARRAY使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NEWARRAY类属于org.apache.bcel.generic包,在下文中一共展示了NEWARRAY类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateStreamer
import org.apache.bcel.generic.NEWARRAY; //导入依赖的package包/类
protected void generateStreamer(ConstantPoolGen cp, InstructionList il, InstructionFactory factory, String className, boolean hasHeader)
{
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionConstants.ALOAD_1);
il.append(InstructionConstants.DUP2);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readInt", Type.INT, Type.NO_ARGS, INVOKEINTERFACE));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createPutField(className, "fN", Type.INT));
il.append(new NEWARRAY(Type.FLOAT));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readFixedArray", Type.VOID, arrayArgType, INVOKEINTERFACE));
il.append(factory.createPutField(className, "fArray", RootType.FLOATARRAY));
}
开发者ID:diana-hep,项目名称:root4j,代码行数:14,代码来源:TArrayF.java
示例2: generateStreamer
import org.apache.bcel.generic.NEWARRAY; //导入依赖的package包/类
protected void generateStreamer(ConstantPoolGen cp, InstructionList il, InstructionFactory factory, String className, boolean hasHeader)
{
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionConstants.ALOAD_1);
il.append(InstructionConstants.DUP2);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readInt", Type.INT, Type.NO_ARGS, INVOKEINTERFACE));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createPutField(className, "fN", Type.INT));
il.append(new NEWARRAY(Type.CHAR));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readFixedArray", Type.VOID, arrayArgType, INVOKEINTERFACE));
il.append(factory.createPutField(className, "fArray", RootType.CHARARRAY));
}
开发者ID:diana-hep,项目名称:root4j,代码行数:14,代码来源:TArrayC.java
示例3: generateStreamer
import org.apache.bcel.generic.NEWARRAY; //导入依赖的package包/类
protected void generateStreamer(ConstantPoolGen cp, InstructionList il, InstructionFactory factory, String className, boolean hasHeader)
{
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionConstants.ALOAD_1);
il.append(InstructionConstants.DUP2);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readInt", Type.INT, Type.NO_ARGS, INVOKEINTERFACE));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createPutField(className, "fN", Type.INT));
il.append(new NEWARRAY(Type.DOUBLE));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readFixedArray", Type.VOID, arrayArgType, INVOKEINTERFACE));
il.append(factory.createPutField(className, "fArray", RootType.DOUBLEARRAY));
}
开发者ID:diana-hep,项目名称:root4j,代码行数:14,代码来源:TArrayD.java
示例4: generateStreamer
import org.apache.bcel.generic.NEWARRAY; //导入依赖的package包/类
protected void generateStreamer(ConstantPoolGen cp, InstructionList il, InstructionFactory factory, String className, boolean hasHeader)
{
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionConstants.ALOAD_1);
il.append(InstructionConstants.DUP2);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readInt", Type.INT, Type.NO_ARGS, INVOKEINTERFACE));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createPutField(className, "fN", Type.INT));
il.append(new NEWARRAY(Type.INT));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readFixedArray", Type.VOID, arrayArgType, INVOKEINTERFACE));
il.append(factory.createPutField(className, "fArray", RootType.INTARRAY));
}
开发者ID:diana-hep,项目名称:root4j,代码行数:14,代码来源:TArrayI.java
示例5: generateReadCode
import org.apache.bcel.generic.NEWARRAY; //导入依赖的package包/类
public void generateReadCode(InstructionList il, InstructionFactory factory, ConstantPoolGen cp, String className)
{
if (pointer)
{
((GenericRootClass) varClass).generateReadPointerCode(il, factory, cp);
}
else if (dim == 0)
{
varClass.generateReadCode(il, factory, cp);
}
else if (varCounter == null)
{
((IntrinsicRootClass) varClass).generateReadArrayCode(il, factory, cp, 1, new int[]{index});
}
else
{
BasicMember varMember = getMember(varCounter);
if (varMember == null) throw new RuntimeException("Cannot find variable counter "+varCounter);
Type varMemberType = varMember.getJavaType();
il.append(InstructionConstants.ALOAD_0);
il.append(factory.createInvoke(className, nameMangler.mangleMember(varCounter), varMemberType, Type.NO_ARGS, INVOKESPECIAL));
if (varMemberType != Type.INT && varMemberType != Type.BYTE && varMemberType != Type.CHAR && varMemberType != Type.SHORT)
il.append(factory.createCast(varMemberType, Type.INT));
BasicType type = (BasicType) varClass.getJavaType();
il.append(new NEWARRAY(type));
il.append(InstructionConstants.DUP_X1);
Type[] arrayArgType = new Type[] { new ArrayType(type, 1) };
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readFixedArray", Type.VOID, arrayArgType, INVOKEINTERFACE));
}
if (varClass.getConvertMethod() != null)
{
il.append(factory.createInvoke("org.dianahep.root4j.interfaces." + varClass.getClassName(), varClass.getConvertMethod(), varClass.getJavaTypeForMethod(), Type.NO_ARGS, INVOKEINTERFACE));
}
}
开发者ID:diana-hep,项目名称:root4j,代码行数:37,代码来源:StreamerInfoString.java
示例6: visitNEWARRAY
import org.apache.bcel.generic.NEWARRAY; //导入依赖的package包/类
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
public void visitNEWARRAY(NEWARRAY o){
byte t = o.getTypecode();
if (! ( (t == Constants.T_BOOLEAN) ||
(t == Constants.T_CHAR) ||
(t == Constants.T_FLOAT) ||
(t == Constants.T_DOUBLE) ||
(t == Constants.T_BYTE) ||
(t == Constants.T_SHORT) ||
(t == Constants.T_INT) ||
(t == Constants.T_LONG) ) ){
constraintViolated(o, "Illegal type code '+t+' for 'atype' operand.");
}
}
开发者ID:Hu6,项目名称:VestaClient,代码行数:15,代码来源:Pass3aVerifier.java
示例7: visitAllocationInstruction
import org.apache.bcel.generic.NEWARRAY; //导入依赖的package包/类
public void visitAllocationInstruction( AllocationInstruction i ) {
Type type;
if (i instanceof CPInstruction) {
type = ((CPInstruction) i).getType(_cp);
} else {
type = ((NEWARRAY) i).getType();
}
short opcode = ((Instruction) i).getOpcode();
int dim = 1;
switch (opcode) {
case Constants.NEW:
_out.println("il.append(_factory.createNew(\"" + ((ObjectType) type).getClassName()
+ "\"));");
break;
case Constants.MULTIANEWARRAY:
dim = ((MULTIANEWARRAY) i).getDimensions();
case Constants.ANEWARRAY:
case Constants.NEWARRAY:
if (type instanceof ArrayType) {
type = ((ArrayType) type).getBasicType();
}
_out.println("il.append(_factory.createNewArray(" + BCELifier.printType(type)
+ ", (short) " + dim + "));");
break;
default:
throw new RuntimeException("Oops: " + opcode);
}
}
开发者ID:Hu6,项目名称:VestaClient,代码行数:29,代码来源:BCELFactory.java
示例8: noAliasesStoreWithIndexBefore
import org.apache.bcel.generic.NEWARRAY; //导入依赖的package包/类
/**
* Checks that any store in this basic block to the specified variable is the
* result of a new() or a null.
* @param ih handle up to where to investigate.
* @param localVarIndex the local variable index
* @return true if all stores are OK or there are no stores.
*/
boolean noAliasesStoreWithIndexBefore(InstructionHandle ih, LocalVariableGen lg) {
InstructionHandle prev = null;
for (InstructionContext ic : instructions) {
InstructionHandle current = ic.getInstruction();
if (current.equals(ih)) {
break;
}
if (methodGen.instructionStoresTo(current, lg.getIndex())) {
LocalVariableGen l1 = methodGen.findLocalVar(current, lg.getIndex(), false);
if (l1 != lg) {
prev = current;
continue;
}
if (prev != null) {
Instruction i = prev.getInstruction();
if (i instanceof INVOKESPECIAL) {
INVOKESPECIAL invoker = (INVOKESPECIAL) i;
if (invoker.getMethodName(methodGen.getConstantPool()).equals("<init>")
&& isNonEscapingConstructor(invoker)) {
continue;
}
}
if (i instanceof CHECKCAST) {
InstructionHandle pp = prev.getPrev();
if (pp != null) {
i = pp.getInstruction();
}
}
if (i instanceof NEWARRAY
|| i instanceof ANEWARRAY || i instanceof MULTIANEWARRAY
|| i instanceof ConstantPushInstruction || i instanceof ACONST_NULL) {
prev = current;
continue;
}
}
return false;
}
prev = current;
}
return true;
}
开发者ID:pieterhijma,项目名称:cashmere,代码行数:51,代码来源:LoadAwareBasicBlock.java
示例9: emitNEWARRAY
import org.apache.bcel.generic.NEWARRAY; //导入依赖的package包/类
private void emitNEWARRAY(Element xml_inst, NEWARRAY inst) {
xml_inst.setAttribute("base-type", inst.getType().toString().replace("[]", ""));
}
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:ClassToXmlvmProcess.java
示例10: visitNEWARRAY
import org.apache.bcel.generic.NEWARRAY; //导入依赖的package包/类
@Override
public void visitNEWARRAY(NEWARRAY obj) {
modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
produce(IsNullValue.nonNullValue());
}
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:6,代码来源:IsNullValueFrameModelingVisitor.java
注:本文中的org.apache.bcel.generic.NEWARRAY类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论