本文整理汇总了Java中org.apache.bcel.Constants.T_LONG属性的典型用法代码示例。如果您正苦于以下问题:Java Constants.T_LONG属性的具体用法?Java Constants.T_LONG怎么用?Java Constants.T_LONG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.bcel.Constants
的用法示例。
在下文中一共展示了Constants.T_LONG属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pushValue
/**
* Work around some weirdness in BCEL (inherited from JVM Spec 1):
* BCEL considers long and double types to consume two slots on the
* stack. This method ensures that we push two types for
* each double or long value.
*/
protected void pushValue(Type type) {
BetterTypeFrame frame = getFrame();
if (type.getTypeCode() == Constants.T_LONG) {
frame.pushValue(typeRepository.getLongType());
frame.pushValue(typeRepository.getLongExtraType());
} else if (type.getTypeCode() == Constants.T_DOUBLE) {
frame.pushValue(typeRepository.getDoubleType());
frame.pushValue(typeRepository.getDoubleExtraType());
} else
frame.pushValue(type);
}
示例2: initEntryFact
public void initEntryFact(TypeFrame result) {
// Make the frame valid
result.setValid();
int slot = 0;
// Clear the stack slots in the frame
result.clearStack();
// Add local for "this" pointer, if present
if (!methodGen.isStatic())
result.setValue(slot++, new ObjectType(methodGen.getClassName()));
// Add locals for parameters.
// Note that long and double parameters need to be handled
// specially because they occupy two locals.
Type[] argumentTypes = methodGen.getArgumentTypes();
for (int i = 0; i < argumentTypes.length; ++i) {
Type argType = argumentTypes[i];
// Add special "extra" type for long or double params.
// These occupy the slot before the "plain" type.
if (argType.getType() == Constants.T_LONG) {
result.setValue(slot++, TypeFrame.getLongExtraType());
} else if (argType.getType() == Constants.T_DOUBLE) {
result.setValue(slot++, TypeFrame.getDoubleExtraType());
}
// Add the plain parameter type.
result.setValue(slot++, argType);
}
// Set remaining locals to BOTTOM; this will cause any
// uses of them to be flagged
while (slot < methodGen.getMaxLocals())
result.setValue(slot++, TypeFrame.getBottomType());
}
示例3: initEntryFact
public void initEntryFact(BetterTypeFrame result) throws DataflowAnalysisException {
try {
result.setValid();
int local = 0;
// Instance methods have the "this" reference in local slot zero
if (!methodGen.isStatic()) {
result.setValue(local++, typeRepository.classTypeFromDottedClassName(methodGen.getClassName()));
}
// Fill in parameter types
for (int i = 0; i < parameterSignatureList.length; ++i) {
String signature = parameterSignatureList[i];
Type type = typeRepository.typeFromSignature(signature);
// Long and double values occupy an extra local slot
if (type.getTypeCode() == Constants.T_LONG) {
result.setValue(local++, typeRepository.getLongExtraType());
} else if (type.getTypeCode() == Constants.T_DOUBLE) {
result.setValue(local++, typeRepository.getDoubleExtraType());
}
// The parameter type
result.setValue(local++, type);
}
// Fill remaining locals with the bottom type.
for (int i = local; i < methodGen.getMaxLocals(); ++i) {
result.setValue(i, typeRepository.getBottomType());
}
} catch (InvalidSignatureException e) {
throw new DataflowAnalysisException("Invalid parameter type signature", e);
}
}
示例4: setUp
protected void setUp() {
booleanType = new BasicType(Constants.T_BOOLEAN);
byteType = new BasicType(Constants.T_BYTE);
charType = new BasicType(Constants.T_CHAR);
shortType = new BasicType(Constants.T_SHORT);
intType = new BasicType(Constants.T_INT);
longType = new BasicType(Constants.T_LONG);
floatType = new BasicType(Constants.T_FLOAT);
doubleType = new BasicType(Constants.T_DOUBLE);
voidType = new BasicType(Constants.T_VOID);
}