コード例 #1
0
  /** Add an index reference. */
  private int addIndexReference(int tag, int i1, int i2) {

    // search for the item using the pre-allocated object
    searchIndex.set(tag, i1, i2);

    ConstantPoolEntry item = findMatchingEntry(searchIndex);

    if (item == null) {
      item = new CONSTANT_Index_info(tag, i1, i2);
      addEntry(item.getKey(), item);
    }

    return item.getIndex();
  }
コード例 #2
0
  /*
  	public ClassMember findReference(int classIndex, int nameAndTypeIndex) {

  		CONSTANT_Index_info item = findIndexEntry(VMDescriptor.CONSTANT_Methodref,
  				classIndex, nameAndTypeIndex);

  		if (item == null) {

  			item = findIndexEntry(VMDescriptor.CONSTANT_InterfaceMethodref,
  				classIndex, nameAndTypeIndex);

  			if (item == null) {
  				item = findIndexEntry(VMDescriptor.CONSTANT_Fieldref,
  					classIndex, nameAndTypeIndex);

  				if (item == null)
  					return null;

  			}
  		}

  		return new ReferenceMember(this, item);
  	}
  */
  protected CONSTANT_Index_info findIndexEntry(int tag, int i1, int i2) {
    // search for the item using the pre-allocated object
    searchIndex.set(tag, i1, i2);

    return (CONSTANT_Index_info) findMatchingEntry(searchIndex);
  }