本文整理汇总了Java中com.sun.org.apache.bcel.internal.Constants.T_ADDRESS属性的典型用法代码示例。如果您正苦于以下问题:Java Constants.T_ADDRESS属性的具体用法?Java Constants.T_ADDRESS怎么用?Java Constants.T_ADDRESS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.org.apache.bcel.internal.Constants
的用法示例。
在下文中一共展示了Constants.T_ADDRESS属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addLocalVariable
/**
* Adds a local variable to this method.
*
* @param name variable name
* @param type variable type
* @param slot the index of the local variable, if type is long or double, the next available
* index is slot+2
* @param start from where the variable is valid
* @param end until where the variable is valid
* @return new local variable object
* @see LocalVariable
*/
public LocalVariableGen addLocalVariable(String name, Type type, int slot,
InstructionHandle start,
InstructionHandle end) {
byte t = type.getType();
if(t != Constants.T_ADDRESS) {
int add = type.getSize();
if(slot + add > max_locals)
max_locals = slot + add;
LocalVariableGen l = new LocalVariableGen(slot, name, type, start, end);
int i;
if((i = variable_vec.indexOf(l)) >= 0) // Overwrite if necessary
variable_vec.set(i, l);
else
variable_vec.add(l);
return l;
} else {
throw new IllegalArgumentException("Can not use " + type +
" as type for local variable");
}
}
示例2: addLocalVariableType
/**
* Adds a local variable type to this method.
*
* @param name variable name
* @param type variable type
* @param slot the index of the local variable, if type is long or double, the next available
* index is slot+2
* @param start from where the variable is valid
* @param end until where the variable is valid
* @return new local variable object
* @see LocalVariable
*/
private LocalVariableGen addLocalVariableType(String name, Type type, int slot,
InstructionHandle start,
InstructionHandle end) {
byte t = type.getType();
if(t != Constants.T_ADDRESS) {
int add = type.getSize();
if(slot + add > max_locals)
max_locals = slot + add;
LocalVariableGen l = new LocalVariableGen(slot, name, type, start, end);
int i;
if((i = type_vec.indexOf(l)) >= 0) // Overwrite if necessary
type_vec.set(i, l);
else
type_vec.add(l);
return l;
} else {
throw new IllegalArgumentException("Can not use " + type +
" as type for local variable");
}
}
示例3: setType
public void setType(Type type) {
if(type.getType() == Constants.T_ADDRESS)
throw new IllegalArgumentException("Type can not be " + type);
this.type = type;
}
示例4: ReturnaddressType
/**
* A Returnaddress [that doesn't know where to return to].
*/
private ReturnaddressType(){
super(Constants.T_ADDRESS, "<return address>");
}