/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/** <P> This is a basic implementation of the Type interface which
should be complete enough to be portable across platforms. The
only issue will be the construction of these objects and their
components from the platform-specific debugging information; see
BasicTypeDataBase. </P>
<P> There are two types of clients of this class. The first is
that which builds the TypeDatabase. This kind of client uses the
additional public methods beyond those in the Type interface to
properly configure the BasicType objects. The second is the
consumer of these types; this kind of client should deal only with
the Type interfaces. </P> */
private long size;
private boolean isJavaPrimitiveType;
private boolean isOopType;
// These are only the fields defined in this class, not any of this
// class's superclasses.
// Superclass, or null if none. Primitive types do not have any
// inheritance relationship.
/** superclass may be null */
throw new IllegalArgumentException("name may not be null");
}
this.superclass = superclass;
}
/** Equivalent to BasicType(db, name, null) */
}
return false;
}
return false;
}
return false;
}
return true;
}
public int hashCode() {
}
return name;
}
return name;
}
/** This should only be called at most once, and only by the builder
of the type database */
this.superclass = superclass;
}
return superclass;
}
/** This should only be called at most once, and only by the builder
of the type database */
this.size = sizeInBytes;
}
public long getSize() {
return size;
}
/** Overridden by BasicCIntegerType */
public boolean isCIntegerType() {
return false;
}
public boolean isCStringType() {
if (isPointerType()) {
return target.isCIntegerType() &&
} else {
return false;
}
}
public boolean isJavaPrimitiveType() {
return isJavaPrimitiveType;
}
/** This should only be called at most once, and only by the builder
of the type database */
}
public boolean isOopType() {
return isOopType;
}
/** Overridden by BasicPointerType */
public boolean isPointerType() {
return false;
}
/** This should only be called at most once, and only by the builder
of the type database */
}
boolean throwExceptionIfNotFound) {
if (nameToFieldMap != null) {
return field;
}
}
if (searchSuperclassFields) {
if (superclass != null) {
}
}
}
return field;
}
}
}
boolean searchSuperclassFields) throws WrongTypeException {
return null;
}
" is not of type " + declaredType +
}
return res;
}
}
/** The returned iterator's "remove" method must not be called */
}
//--------------------------------------------------------------------------------
// Specialized field type accessors
//
}
}
}
}
}
}
}
}
" is not of C integer type, but instead of type " +
}
return (CIntegerField) field;
}
" is not of oop type, but instead of type " +
}
}
}
// This type can not be inferred (for now), so provide a wrapper
return null;
}
return new BasicAddressFieldWrapper(field);
}
/** This method should only be used by the builder of the
TypeDataBase. Throws a RuntimeException if a field with this
name was already present in this class. */
throw new RuntimeException("field of name \"" + field.getName() + "\" already present in type " + this);
}
}
/** This method should only be used by the builder of the
TypeDataBase. Throws a RuntimeException if a field with this
name was not present in this class. */
}
}
}