review(S): 7058510: multinewarray with 6 dimensions uncommon traps in server compiler
john.r.rose at oracle.com
Fri Jul 1 14:08:52 PDT 2011
On Jul 1, 2011, at 2:01 PM, Peter B. Kessler wrote:
> I don't know the opto/runtime style, but there sure seems to be a lot of copying of the array dimensions. Could you make up the jint array early and just pass that around, or do you need the Node array of intcon's. (E.g., do you need them for the type mechanisms?) This is more a question for my understanding than a comment on your code.
That was the first thought, but C2 is not cooperative about allocating arrays in the stack frame. It wants to treat the stack frame as a sea of virtual registers.
The workaround for that limitation is to use Java varargs instead of C varargs. Yes, that requires extra copying, but it is a trivial amount of copying compared to the size of almost any rank-6 array you can imagine creating.
At least some of the lower-rank cases (2..5) cover the case of a small low-rank array, for which the allocation of a Java dope vector would be a significant overhead.
Good catch about the rank-1 case. That should still be a ShouldNotReachHere.
More information about the hotspot-compiler-dev