当前位置: 首页>>代码示例>>Java>>正文


Java Constants.T_LONG属性代码示例

本文整理汇总了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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:BetterTypeFrameModelingVisitor.java

示例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());
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:TypeAnalysis.java

示例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);
	}
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:35,代码来源:BetterTypeAnalysis.java

示例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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:BasicTypeTest.java


注:本文中的org.apache.bcel.Constants.T_LONG属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。