This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Kava for GCJ?


> > > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]