On the 0x25B day of Apache Harmony Mikhail Fursov wrote: > On 1/11/07, Alexey Varlamov <[EMAIL PROTECTED]> wrote: > > > > Hmm, AFAIU "optimized" arraycopy has no GC specifics. Moreover it is, > > like API magics, codegen-specific and I do not quite see how it can be > > expressed in vmmagics... > > > One of the GC specific issues is WB :) But we can have several options how > optimize array copy in JIT: make a loop and remove call, use special CPU > instructions... > After some thoughts I agree that VM magic is not the best candidate here and > additional WB method to report several entries at once can be a better > solution.
Yes, that pretty looks like JIT internals (a special inst for rep mov). The problem with current impl is that it is not easy to read. Writing the most of JIT-arraycopy in Java would help. So, to be elegant at the maximum we could make a "JIT-magic-in-Java" -- a simple method that does all the exceptions & slowpath tricks in Java leaving the fastpath to JIT. This JIT-magic can be resolved and inlined in translator. -- Egor Pasko
