This is the mail archive of the kawa@sourceware.org mailing list for the Kawa 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: Compiling multidimensional arrays


On 09/12/2013 05:51 PM, Charles Turner wrote:
The branching order is an instanceof ObjectType test, and if that
fails, an instanceof ArrayType test. What? ArrayType is a subclass of
ObjectType! How can that branch be taken? Because of that, it seems
Kawa will never emit the multianewarray instruction even if it
correctly handled md arrays in the first place. In r1378, Per made the
following comment:

(emitNewArray):  Use anewarray even if element type is ArrayType.

I assume that's because md arrays don't work anyway, so it makes sense
to use the faster anewarray when creating arrays of one dimension, but
why keep the old instanceof ArrayType branch around and not even
comment why it's there? Am I missing something?

I checked in a fix so the logic makes sense, though multianewarray
is only used when dims > 1 - which doesn't happen in the Kawa codebase.
I also noted in the comment that the dims>1 case isn't tested ...
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


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