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


Java Constants.T_ADDRESS属性代码示例

本文整理汇总了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");

  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:MethodGen.java

示例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");

  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:MethodGen.java

示例3: setType

public void            setType(Type type)   {
  if(type.getType() == Constants.T_ADDRESS)
    throw new IllegalArgumentException("Type can not be " + type);

  this.type = type;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:FieldGenOrMethodGen.java

示例4: ReturnaddressType

/**
 * A Returnaddress [that doesn't know where to return to].
 */
private ReturnaddressType(){
  super(Constants.T_ADDRESS, "<return address>");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:ReturnaddressType.java


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