On Feb 10, 2015, at 3:15 PM, Martin Buchholz <marti...@google.com> wrote: > > I was surprised that System.arraycopy hasn't been specialized for every > array type. > I guess the JIT is good at specializing all callers.
Yes. Usually the arguments have specific static types the JIT can see. The Object formal type doesn't obscure this. > I don't know whether we will someday regret the explosion of array > comparison methods. It's technical debt. When we go to value types there will be an infinite number of array types. That's why in Project Valhalla we are thinking hard, before that, about parametric polymorphism. We need to be able to have true polymorphism over APIs in T[], where T can be ref, prim, or value. At that point, hopefully, what we have won't be impossible to retrofit. — John