This is the mail archive of the java-patches@sources.redhat.com 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]

Re: Speed up array allocation


While this is a reasonable patch, I ask myself: Why is
_Jv_GetArrayElementFromElementType being called for on each plain
(non-reflective) array allocation (judging from the benchmark)?
Two alternatives come to mind:

(1) Call _Jv_GetArrayElementFromElementType at class loading time,
and cache the result in a word, which the compiler uses.

(2)  Create a suitable mangling for array classes, and have the
compiler emit references just like it does for classes.  Have
the linker when it seems references to array types patch them up.
(Requires the hypothetical Java-aware linker.)

Actually, I'm happy with your choice of caching the array type
in a word in the element type - it is probably as good as (1)
and simpler.  But once we have our Java-aware linker, then (2)
should be considered.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

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