"Mark S. Miller" <markm@caplet.com> writes:
The gnu.bytecode.Type is an abstract "type" concept, similar
to your SlotGuard idea. It includes the following methods:
public abstract class Type {
public abstract Object coerceFromObject (Object obj);
public Object coerceToObject (Object obj)
{
/** Compile code to coerce/convert from Object to this type. */
public void emitCoerceFromObject (CodeAttr code)
{
...
return obj;
}
/** Compile code to convert an object (on the stack) to this Type. */
public void emitCoerceToObject (CodeAttr code)
{
}
throw new Error ("unimplemented emitCoerceFromObject for "+this);
}
-- --Per Bothner per@bothner.com http://www.bothner.com/~per/