Kava for GCJ?

Adam Megacz gcj@lists.megacz.com
Sat Jul 5 20:31:00 GMT 2003


> > > why not let the compiler itself discover classes with these
> > > restrictions?

> > Because treating a class as 'by value' alters the semantics of

> > Thing a = new Thing();
> > Thing b = a;

> - class variables may not be compared to each other

Hrm, so what if you have class ValueType which is used by classes A
and B. A performs equality comparisons on instances of ValueType, but
B does not. A and B are compiled seperately. Now the compiled code
for A will treat ValueType as a heap object, but B will treat it as a
stack object.
Also, what if you have a class that happens to meet these criteria,
but gets casted to and from Object quite often? How do you prevent
the compiler from treating the class as a value type in order to
prevent a huge number of boxing/unboxing operations?
 - a


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /