instanceof in CNI

Per Bothner
Sun Mar 26 21:01:00 GMT 2000

Tom Tromey <> writes:
> Do you mean `Class *$class'?  To me that seems more natural.  We could
> do that without changing the mangling or anything; just add a new
> static to each class.

No, I mean Class $class.  The thing is - we already generate a
static Class field (not Class* field) - the actual Class object.
We just need to make sure it has a reasonable name (`class'
would be nice, since that's what Java does in the syntax `String.class'.
Unfortunately, the C++ parser won't like that, without ugly hacking
that seems hard to justify.  Hence `$class'.

There are other options, including the inline function you
suggested, or a builtin operator like __jv_classof.  I like
the simplicit of using thefield we are already generating.
I think we are currently calling it `class'.

	--Per Bothner

More information about the Java mailing list